video_writer.h 1.39 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 *  Copyright (c) 2014 The WebM project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#ifndef VIDEO_WRITER_H_
#define VIDEO_WRITER_H_

#include "./video_common.h"

Yaowu Xu's avatar
Yaowu Xu committed
16
typedef enum { kContainerIVF } AvxContainer;
17

Yaowu Xu's avatar
Yaowu Xu committed
18 19
struct AvxVideoWriterStruct;
typedef struct AvxVideoWriterStruct AvxVideoWriter;
20 21 22 23 24 25

#ifdef __cplusplus
extern "C" {
#endif

// Finds and opens writer for specified container format.
Yaowu Xu's avatar
Yaowu Xu committed
26
// Returns an opaque AvxVideoWriter* upon success, or NULL upon failure.
27
// Right now only IVF format is supported.
Yaowu Xu's avatar
Yaowu Xu committed
28 29 30
AvxVideoWriter *aom_video_writer_open(const char *filename,
                                      AvxContainer container,
                                      const AvxVideoInfo *info);
31

Yaowu Xu's avatar
Yaowu Xu committed
32 33 34
// Frees all resources associated with AvxVideoWriter* returned from
// aom_video_writer_open() call.
void aom_video_writer_close(AvxVideoWriter *writer);
35 36

// Writes frame bytes to the file.
Yaowu Xu's avatar
Yaowu Xu committed
37
int aom_video_writer_write_frame(AvxVideoWriter *writer, const uint8_t *buffer,
clang-format's avatar
clang-format committed
38
                                 size_t size, int64_t pts);
39 40 41 42 43 44

#ifdef __cplusplus
}  // extern "C"
#endif

#endif  // VIDEO_WRITER_H_