In android video encoder wrapper fill codec-agnostic frame dependencies
These structures are needed to populate dependency descritpor rtp header extension. Bug: webrtc:10342 Change-Id: If6bb533544ae3aa718d0e8506bb6d1fa43df345f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/206985 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33243}
This commit is contained in:
committed by
Commit Bot
parent
590b1bad08
commit
aee2c6a532
@ -655,6 +655,7 @@ if (current_os == "linux" || is_android) {
|
|||||||
"../../modules/video_coding:codec_globals_headers",
|
"../../modules/video_coding:codec_globals_headers",
|
||||||
"../../modules/video_coding:video_codec_interface",
|
"../../modules/video_coding:video_codec_interface",
|
||||||
"../../modules/video_coding:video_coding_utility",
|
"../../modules/video_coding:video_coding_utility",
|
||||||
|
"../../modules/video_coding/svc:scalable_video_controller",
|
||||||
"../../rtc_base",
|
"../../rtc_base",
|
||||||
"../../rtc_base:checks",
|
"../../rtc_base:checks",
|
||||||
"../../rtc_base:rtc_task_queue",
|
"../../rtc_base:rtc_task_queue",
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
#include "common_video/h264/h264_common.h"
|
#include "common_video/h264/h264_common.h"
|
||||||
#include "modules/video_coding/include/video_codec_interface.h"
|
#include "modules/video_coding/include/video_codec_interface.h"
|
||||||
#include "modules/video_coding/include/video_error_codes.h"
|
#include "modules/video_coding/include/video_error_codes.h"
|
||||||
|
#include "modules/video_coding/svc/scalable_video_controller_no_layering.h"
|
||||||
#include "modules/video_coding/utility/vp8_header_parser.h"
|
#include "modules/video_coding/utility/vp8_header_parser.h"
|
||||||
#include "modules/video_coding/utility/vp9_uncompressed_header_parser.h"
|
#include "modules/video_coding/utility/vp9_uncompressed_header_parser.h"
|
||||||
#include "rtc_base/logging.h"
|
#include "rtc_base/logging.h"
|
||||||
@ -325,6 +326,19 @@ CodecSpecificInfo VideoEncoderWrapper::ParseCodecSpecificInfo(
|
|||||||
const bool key_frame = frame._frameType == VideoFrameType::kVideoFrameKey;
|
const bool key_frame = frame._frameType == VideoFrameType::kVideoFrameKey;
|
||||||
|
|
||||||
CodecSpecificInfo info;
|
CodecSpecificInfo info;
|
||||||
|
// For stream with scalability, NextFrameConfig should be called before
|
||||||
|
// encoding and used to configure encoder, then passed here e.g. via
|
||||||
|
// FrameExtraInfo structure. But while this encoder wrapper uses only trivial
|
||||||
|
// scalability, NextFrameConfig can be called here.
|
||||||
|
auto layer_frames = svc_controller_.NextFrameConfig(/*reset=*/key_frame);
|
||||||
|
RTC_DCHECK_EQ(layer_frames.size(), 1);
|
||||||
|
info.generic_frame_info = svc_controller_.OnEncodeDone(layer_frames[0]);
|
||||||
|
if (key_frame) {
|
||||||
|
info.template_structure = svc_controller_.DependencyStructure();
|
||||||
|
info.template_structure->resolutions = {
|
||||||
|
RenderResolution(frame._encodedWidth, frame._encodedHeight)};
|
||||||
|
}
|
||||||
|
|
||||||
info.codecType = codec_settings_.codecType;
|
info.codecType = codec_settings_.codecType;
|
||||||
|
|
||||||
switch (codec_settings_.codecType) {
|
switch (codec_settings_.codecType) {
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
#define SDK_ANDROID_SRC_JNI_VIDEO_ENCODER_WRAPPER_H_
|
#define SDK_ANDROID_SRC_JNI_VIDEO_ENCODER_WRAPPER_H_
|
||||||
|
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -21,6 +22,7 @@
|
|||||||
#include "api/video_codecs/video_encoder.h"
|
#include "api/video_codecs/video_encoder.h"
|
||||||
#include "common_video/h264/h264_bitstream_parser.h"
|
#include "common_video/h264/h264_bitstream_parser.h"
|
||||||
#include "modules/video_coding/codecs/vp9/include/vp9_globals.h"
|
#include "modules/video_coding/codecs/vp9/include/vp9_globals.h"
|
||||||
|
#include "modules/video_coding/svc/scalable_video_controller_no_layering.h"
|
||||||
#include "rtc_base/synchronization/mutex.h"
|
#include "rtc_base/synchronization/mutex.h"
|
||||||
#include "sdk/android/src/jni/jni_helpers.h"
|
#include "sdk/android/src/jni/jni_helpers.h"
|
||||||
#include "sdk/android/src/jni/video_frame.h"
|
#include "sdk/android/src/jni/video_frame.h"
|
||||||
@ -96,6 +98,8 @@ class VideoEncoderWrapper : public VideoEncoder {
|
|||||||
EncoderInfo encoder_info_;
|
EncoderInfo encoder_info_;
|
||||||
H264BitstreamParser h264_bitstream_parser_;
|
H264BitstreamParser h264_bitstream_parser_;
|
||||||
|
|
||||||
|
// Fills frame dependencies in codec-agnostic format.
|
||||||
|
ScalableVideoControllerNoLayering svc_controller_;
|
||||||
// VP9 variables to populate codec specific structure.
|
// VP9 variables to populate codec specific structure.
|
||||||
GofInfoVP9 gof_; // Contains each frame's temporal information for
|
GofInfoVP9 gof_; // Contains each frame's temporal information for
|
||||||
// non-flexible VP9 mode.
|
// non-flexible VP9 mode.
|
||||||
|
|||||||
Reference in New Issue
Block a user