176e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org/* 276e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org * Copyright (c) 2014 The WebM project authors. All Rights Reserved. 376e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org * 476e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org * Use of this source code is governed by a BSD-style license 576e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org * that can be found in the LICENSE file in the root of the source 676e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org * tree. An additional intellectual property rights grant can be found 776e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org * in the file PATENTS. All contributing project authors may 876e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org * be found in the AUTHORS file in the root of the source tree. 976e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org */ 1076e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org 1176e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org#ifndef VIDEO_WRITER_H_ 1276e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org#define VIDEO_WRITER_H_ 1376e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org 1476e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org#include "./video_common.h" 1576e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org 1676e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.orgtypedef enum { 1776e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org kContainerIVF 1876e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org} VpxContainer; 1976e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org 2076e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.orgstruct VpxVideoWriterStruct; 2176e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.orgtypedef struct VpxVideoWriterStruct VpxVideoWriter; 2276e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org 2376e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org#ifdef __cplusplus 2476e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.orgextern "C" { 2576e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org#endif 2676e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org 2776e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org// Finds and opens writer for specified container format. 2876e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org// Returns an opaque VpxVideoWriter* upon success, or NULL upon failure. 2976e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org// Right now only IVF format is supported. 3076e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.orgVpxVideoWriter *vpx_video_writer_open(const char *filename, 3176e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org VpxContainer container, 3276e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org const VpxVideoInfo *info); 3376e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org 3476e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org// Frees all resources associated with VpxVideoWriter* returned from 3576e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org// vpx_video_writer_open() call. 3676e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.orgvoid vpx_video_writer_close(VpxVideoWriter *writer); 3776e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org 3876e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org// Writes frame bytes to the file. 3976e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.orgint vpx_video_writer_write_frame(VpxVideoWriter *writer, 4076e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org const uint8_t *buffer, size_t size, 4176e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org int64_t pts); 4276e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org 4376e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org#ifdef __cplusplus 4476e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org} // extern "C" 4576e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org#endif 4676e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org 4776e516e2154f353aa02c504bac88afb0f95fefa7johannkoenig@chromium.org#endif // VIDEO_WRITER_H_ 48