2015-11-18 22:00:21 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2012 The WebRTC 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODEC_INTERFACE_H_
|
|
|
|
|
#define MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODEC_INTERFACE_H_
|
2015-11-18 22:00:21 +01:00
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "api/video/video_frame.h"
|
|
|
|
|
#include "api/video_codecs/video_decoder.h"
|
|
|
|
|
#include "api/video_codecs/video_encoder.h"
|
2017-09-15 13:58:09 +02:00
|
|
|
#include "common_types.h" // NOLINT(build/include)
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/include/module_common_types.h"
|
|
|
|
|
#include "modules/video_coding/include/video_error_codes.h"
|
2015-11-18 22:00:21 +01:00
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
namespace webrtc {
|
2015-11-18 22:00:21 +01:00
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
class RTPFragmentationHeader; // forward declaration
|
2015-11-18 22:00:21 +01:00
|
|
|
|
|
|
|
|
// Note: if any pointers are added to this struct, it must be fitted
|
|
|
|
|
// with a copy-constructor. See below.
|
|
|
|
|
struct CodecSpecificInfoVP8 {
|
|
|
|
|
bool nonReference;
|
|
|
|
|
uint8_t temporalIdx;
|
|
|
|
|
bool layerSync;
|
|
|
|
|
int8_t keyIdx; // Negative value to skip keyIdx.
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct CodecSpecificInfoVP9 {
|
2018-03-15 12:28:53 +01:00
|
|
|
bool first_frame_in_picture; // First frame, increment picture_id.
|
2015-11-18 22:00:21 +01:00
|
|
|
bool inter_pic_predicted; // This layer frame is dependent on previously
|
|
|
|
|
// coded frame(s).
|
|
|
|
|
bool flexible_mode;
|
|
|
|
|
bool ss_data_available;
|
2018-04-24 20:13:49 +02:00
|
|
|
bool non_ref_for_inter_layer_pred;
|
2015-11-18 22:00:21 +01:00
|
|
|
|
|
|
|
|
uint8_t temporal_idx;
|
|
|
|
|
bool temporal_up_switch;
|
|
|
|
|
bool inter_layer_predicted; // Frame is dependent on directly lower spatial
|
|
|
|
|
// layer frame.
|
|
|
|
|
uint8_t gof_idx;
|
|
|
|
|
|
|
|
|
|
// SS data.
|
|
|
|
|
size_t num_spatial_layers; // Always populated.
|
|
|
|
|
bool spatial_layer_resolution_present;
|
|
|
|
|
uint16_t width[kMaxVp9NumberOfSpatialLayers];
|
|
|
|
|
uint16_t height[kMaxVp9NumberOfSpatialLayers];
|
|
|
|
|
GofInfoVP9 gof;
|
|
|
|
|
|
|
|
|
|
// Frame reference data.
|
|
|
|
|
uint8_t num_ref_pics;
|
|
|
|
|
uint8_t p_diff[kMaxVp9RefPics];
|
2018-04-04 11:45:41 +02:00
|
|
|
|
2018-04-24 21:29:14 +02:00
|
|
|
bool end_of_picture;
|
2015-11-18 22:00:21 +01:00
|
|
|
};
|
|
|
|
|
|
2016-12-06 05:36:03 -08:00
|
|
|
struct CodecSpecificInfoH264 {
|
|
|
|
|
H264PacketizationMode packetization_mode;
|
|
|
|
|
};
|
2015-11-18 22:00:21 +01:00
|
|
|
|
|
|
|
|
union CodecSpecificInfoUnion {
|
|
|
|
|
CodecSpecificInfoVP8 VP8;
|
|
|
|
|
CodecSpecificInfoVP9 VP9;
|
|
|
|
|
CodecSpecificInfoH264 H264;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Note: if any pointers are added to this struct or its sub-structs, it
|
|
|
|
|
// must be fitted with a copy-constructor. This is because it is copied
|
|
|
|
|
// in the copy-constructor of VCMEncodedFrame.
|
2015-12-21 04:12:39 -08:00
|
|
|
struct CodecSpecificInfo {
|
2018-08-16 14:35:26 +02:00
|
|
|
CodecSpecificInfo() : codecType(kVideoCodecGeneric), codec_name(nullptr) {
|
2018-06-21 16:16:38 +02:00
|
|
|
memset(&codecSpecific, 0, sizeof(codecSpecific));
|
|
|
|
|
}
|
2015-12-21 04:12:39 -08:00
|
|
|
VideoCodecType codecType;
|
2018-10-24 11:32:39 +02:00
|
|
|
// |codec_name| is deprecated, use name provided by VideoEncoder instead.
|
2016-09-01 00:21:16 -07:00
|
|
|
const char* codec_name;
|
2015-12-21 04:12:39 -08:00
|
|
|
CodecSpecificInfoUnion codecSpecific;
|
2015-11-18 22:00:21 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODEC_INTERFACE_H_
|