blob: ad9e6ebb9837625d3144ab65987217de0e82dd5a [file] [log] [blame]
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -08001/*
Yaowu Xu9c01aa12016-09-01 14:32:49 -07002 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -08003 *
Yaowu Xu9c01aa12016-09-01 14:32:49 -07004 * This source code is subject to the terms of the BSD 2 Clause License and
5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6 * was not distributed with this source code in the LICENSE file, you can
7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8 * Media Patent License 1.0 was not distributed with this source code in the
9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -080010 */
11
12#ifndef VIDEO_WRITER_H_
13#define VIDEO_WRITER_H_
14
15#include "./video_common.h"
16
Yaowu Xuf883b422016-08-30 14:01:10 -070017typedef enum { kContainerIVF } AvxContainer;
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -080018
Yaowu Xuf883b422016-08-30 14:01:10 -070019struct AvxVideoWriterStruct;
20typedef struct AvxVideoWriterStruct AvxVideoWriter;
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -080021
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26// Finds and opens writer for specified container format.
Yaowu Xuf883b422016-08-30 14:01:10 -070027// Returns an opaque AvxVideoWriter* upon success, or NULL upon failure.
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -080028// Right now only IVF format is supported.
Yaowu Xuf883b422016-08-30 14:01:10 -070029AvxVideoWriter *aom_video_writer_open(const char *filename,
30 AvxContainer container,
31 const AvxVideoInfo *info);
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -080032
Yaowu Xuf883b422016-08-30 14:01:10 -070033// Frees all resources associated with AvxVideoWriter* returned from
34// aom_video_writer_open() call.
35void aom_video_writer_close(AvxVideoWriter *writer);
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -080036
37// Writes frame bytes to the file.
Yaowu Xuf883b422016-08-30 14:01:10 -070038int aom_video_writer_write_frame(AvxVideoWriter *writer, const uint8_t *buffer,
clang-format6c4d83e2016-08-08 19:03:30 -070039 size_t size, int64_t pts);
Dmitry Kovalev37e6fd32014-02-05 18:34:46 -080040
41#ifdef __cplusplus
42} // extern "C"
43#endif
44
45#endif // VIDEO_WRITER_H_