da72febb4d347ce30d638292fc412fed2adc27c7
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / video_coding / codecs / interface / video_codec_interface.h
1 /*
2  *  Copyright (c) 2012 The WebRTC 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 WEBRTC_MODULES_VIDEO_CODING_CODECS_INTERFACE_VIDEO_CODEC_INTERFACE_H
12 #define WEBRTC_MODULES_VIDEO_CODING_CODECS_INTERFACE_VIDEO_CODEC_INTERFACE_H
13
14 #include <vector>
15
16 #include "webrtc/common_types.h"
17 #include "webrtc/common_video/interface/i420_video_frame.h"
18 #include "webrtc/modules/interface/module_common_types.h"
19 #include "webrtc/modules/video_coding/codecs/interface/video_error_codes.h"
20 #include "webrtc/typedefs.h"
21 #include "webrtc/video_decoder.h"
22 #include "webrtc/video_encoder.h"
23
24 namespace webrtc
25 {
26
27 class RTPFragmentationHeader; // forward declaration
28
29 // Note: if any pointers are added to this struct, it must be fitted
30 // with a copy-constructor. See below.
31 struct CodecSpecificInfoVP8 {
32   bool hasReceivedSLI;
33   uint8_t pictureIdSLI;
34   bool hasReceivedRPSI;
35   uint64_t pictureIdRPSI;
36   int16_t pictureId;  // Negative value to skip pictureId.
37   bool nonReference;
38   uint8_t simulcastIdx;
39   uint8_t temporalIdx;
40   bool layerSync;
41   int tl0PicIdx;  // Negative value to skip tl0PicIdx.
42   int8_t keyIdx;  // Negative value to skip keyIdx.
43 };
44
45 struct CodecSpecificInfoVP9 {
46   bool hasReceivedSLI;
47   uint8_t pictureIdSLI;
48   bool hasReceivedRPSI;
49   uint64_t pictureIdRPSI;
50   int16_t pictureId;  // Negative value to skip pictureId.
51   bool nonReference;
52   uint8_t temporalIdx;
53   bool layerSync;
54   int tl0PicIdx;  // Negative value to skip tl0PicIdx.
55   int8_t keyIdx;  // Negative value to skip keyIdx.
56 };
57
58 struct CodecSpecificInfoGeneric {
59   uint8_t simulcast_idx;
60 };
61
62 struct CodecSpecificInfoH264 {};
63
64 union CodecSpecificInfoUnion {
65   CodecSpecificInfoGeneric generic;
66   CodecSpecificInfoVP8 VP8;
67   CodecSpecificInfoVP9 VP9;
68   CodecSpecificInfoH264 H264;
69 };
70
71 // Note: if any pointers are added to this struct or its sub-structs, it
72 // must be fitted with a copy-constructor. This is because it is copied
73 // in the copy-constructor of VCMEncodedFrame.
74 struct CodecSpecificInfo
75 {
76     VideoCodecType   codecType;
77     CodecSpecificInfoUnion codecSpecific;
78 };
79
80 }  // namespace webrtc
81
82 #endif // WEBRTC_MODULES_VIDEO_CODING_CODECS_INTERFACE_VIDEO_CODEC_INTERFACE_H