Home | History | Annotate | Download | only in libvpx
      1 /*
      2  *  Copyright (c) 2014 The WebM project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 #ifndef VIDEO_WRITER_H_
     12 #define VIDEO_WRITER_H_
     13 
     14 #include "./video_common.h"
     15 
     16 typedef enum { kContainerIVF } VpxContainer;
     17 
     18 struct VpxVideoWriterStruct;
     19 typedef struct VpxVideoWriterStruct VpxVideoWriter;
     20 
     21 #ifdef __cplusplus
     22 extern "C" {
     23 #endif
     24 
     25 // Finds and opens writer for specified container format.
     26 // Returns an opaque VpxVideoWriter* upon success, or NULL upon failure.
     27 // Right now only IVF format is supported.
     28 VpxVideoWriter *vpx_video_writer_open(const char *filename,
     29                                       VpxContainer container,
     30                                       const VpxVideoInfo *info);
     31 
     32 // Frees all resources associated with VpxVideoWriter* returned from
     33 // vpx_video_writer_open() call.
     34 void vpx_video_writer_close(VpxVideoWriter *writer);
     35 
     36 // Writes frame bytes to the file.
     37 int vpx_video_writer_write_frame(VpxVideoWriter *writer, const uint8_t *buffer,
     38                                  size_t size, int64_t pts);
     39 
     40 #ifdef __cplusplus
     41 }  // extern "C"
     42 #endif
     43 
     44 #endif  // VIDEO_WRITER_H_
     45