Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -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 |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -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. |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 10 | */ |
| 11 | #ifndef WEBMENC_H_ |
| 12 | #define WEBMENC_H_ |
| 13 | |
| 14 | #include <stdio.h> |
| 15 | #include <stdlib.h> |
| 16 | |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 17 | #include "tools_common.h" |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 18 | #include "aom/aom_encoder.h" |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 19 | |
James Zern | 25cfd8e | 2014-01-18 12:16:11 -0800 | [diff] [blame] | 20 | #ifdef __cplusplus |
| 21 | extern "C" { |
| 22 | #endif |
| 23 | |
Vignesh Venkatasubramanian | 9441f10 | 2016-04-25 13:28:24 -0700 | [diff] [blame] | 24 | struct WebmOutputContext { |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 25 | int debug; |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 26 | FILE *stream; |
Vignesh Venkatasubramanian | 2dcbf8c | 2014-03-19 11:56:02 -0700 | [diff] [blame] | 27 | int64_t last_pts_ns; |
| 28 | void *writer; |
| 29 | void *segment; |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | /* Stereo 3D packed frame format */ |
| 33 | typedef enum stereo_format { |
Tom Finegan | 1f0c2e7 | 2013-11-06 10:02:31 -0800 | [diff] [blame] | 34 | STEREO_FORMAT_MONO = 0, |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 35 | STEREO_FORMAT_LEFT_RIGHT = 1, |
| 36 | STEREO_FORMAT_BOTTOM_TOP = 2, |
| 37 | STEREO_FORMAT_TOP_BOTTOM = 3, |
| 38 | STEREO_FORMAT_RIGHT_LEFT = 11 |
| 39 | } stereo_format_t; |
| 40 | |
Vignesh Venkatasubramanian | 9441f10 | 2016-04-25 13:28:24 -0700 | [diff] [blame] | 41 | void write_webm_file_header(struct WebmOutputContext *webm_ctx, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 42 | const aom_codec_enc_cfg_t *cfg, |
clang-format | 6c4d83e | 2016-08-08 19:03:30 -0700 | [diff] [blame] | 43 | stereo_format_t stereo_fmt, unsigned int fourcc, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 44 | const struct AvxRational *par); |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 45 | |
Vignesh Venkatasubramanian | 9441f10 | 2016-04-25 13:28:24 -0700 | [diff] [blame] | 46 | void write_webm_block(struct WebmOutputContext *webm_ctx, |
Yaowu Xu | f883b42 | 2016-08-30 14:01:10 -0700 | [diff] [blame] | 47 | const aom_codec_enc_cfg_t *cfg, |
| 48 | const aom_codec_cx_pkt_t *pkt); |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 49 | |
Vignesh Venkatasubramanian | 9441f10 | 2016-04-25 13:28:24 -0700 | [diff] [blame] | 50 | void write_webm_file_footer(struct WebmOutputContext *webm_ctx); |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 51 | |
James Zern | 25cfd8e | 2014-01-18 12:16:11 -0800 | [diff] [blame] | 52 | #ifdef __cplusplus |
| 53 | } // extern "C" |
| 54 | #endif |
| 55 | |
Tom Finegan | 03848f5 | 2013-11-05 10:02:18 -0800 | [diff] [blame] | 56 | #endif // WEBMENC_H_ |