Dmitry Kovalev | 37e6fd3 | 2014-02-05 18:34:46 -0800 | [diff] [blame] | 1 | /* |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 2 | * Copyright (c) 2016, Alliance for Open Media. All rights reserved |
Dmitry Kovalev | 37e6fd3 | 2014-02-05 18:34:46 -0800 | [diff] [blame] | 3 | * |
Yaowu Xu | 9c01aa1 | 2016-09-01 14:32:49 -0700 | [diff] [blame] | 4 | * 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 Kovalev | 37e6fd3 | 2014-02-05 18:34:46 -0800 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #ifndef VIDEO_WRITER_H_ |
| 13 | #define VIDEO_WRITER_H_ |
| 14 | |
| 15 | #include "./video_common.h" |
| 16 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 17 | typedef enum { kContainerIVF } AvxContainer; |
Dmitry Kovalev | 37e6fd3 | 2014-02-05 18:34:46 -0800 | [diff] [blame] | 18 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 19 | struct AvxVideoWriterStruct; |
| 20 | typedef struct AvxVideoWriterStruct AvxVideoWriter; |
Dmitry Kovalev | 37e6fd3 | 2014-02-05 18:34:46 -0800 | [diff] [blame] | 21 | |
| 22 | #ifdef __cplusplus |
| 23 | extern "C" { |
| 24 | #endif |
| 25 | |
| 26 | // Finds and opens writer for specified container format. |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 27 | // Returns an opaque AvxVideoWriter* upon success, or NULL upon failure. |
Dmitry Kovalev | 37e6fd3 | 2014-02-05 18:34:46 -0800 | [diff] [blame] | 28 | // Right now only IVF format is supported. |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 29 | AvxVideoWriter *aom_video_writer_open(const char *filename, |
| 30 | AvxContainer container, |
| 31 | const AvxVideoInfo *info); |
Dmitry Kovalev | 37e6fd3 | 2014-02-05 18:34:46 -0800 | [diff] [blame] | 32 | |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 33 | // Frees all resources associated with AvxVideoWriter* returned from |
| 34 | // aom_video_writer_open() call. |
| 35 | void aom_video_writer_close(AvxVideoWriter *writer); |
Dmitry Kovalev | 37e6fd3 | 2014-02-05 18:34:46 -0800 | [diff] [blame] | 36 | |
| 37 | // Writes frame bytes to the file. |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 38 | int aom_video_writer_write_frame(AvxVideoWriter *writer, const uint8_t *buffer, |
clang-format | 6c4d83e | 2016-08-08 19:03:30 -0700 | [diff] [blame] | 39 | size_t size, int64_t pts); |
Dmitry Kovalev | 37e6fd3 | 2014-02-05 18:34:46 -0800 | [diff] [blame] | 40 | |
| 41 | #ifdef __cplusplus |
| 42 | } // extern "C" |
| 43 | #endif |
| 44 | |
| 45 | #endif // VIDEO_WRITER_H_ |