Make VideoFrameType an enum class, and move to separate file and target

Bug: webrtc:5876, webrtc:6883
Change-Id: I1435cfa9e8e54c4ba2978261048ff3fbb993ce0e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/126225
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27239}
This commit is contained in:
Niels Möller
2019-03-21 15:43:58 +01:00
committed by Commit Bot
parent 3198fa4956
commit 8f7ce222e7
85 changed files with 685 additions and 589 deletions

View File

@ -398,7 +398,7 @@ int32_t MediaCodecVideoDecoder::Decode(
// Always start with a complete key frame.
if (key_frame_required_) {
if (inputImage._frameType != kVideoFrameKey) {
if (inputImage._frameType != VideoFrameType::kVideoFrameKey) {
ALOGE << "Decode() - key frame is required";
return WEBRTC_VIDEO_CODEC_ERROR;
}
@ -487,8 +487,8 @@ int32_t MediaCodecVideoDecoder::DecodeOnCodecThread(
if (frames_decoded_ < frames_decoded_logged_) {
ALOGD << "Decoder frame in # " << frames_received_
<< ". Type: " << inputImage._frameType << ". Buffer # "
<< j_input_buffer_index
<< ". Type: " << static_cast<int>(inputImage._frameType)
<< ". Buffer # " << j_input_buffer_index
<< ". TS: " << presentation_timestamp_us / 1000
<< ". Size: " << inputImage.size();
}

View File

@ -686,7 +686,8 @@ int32_t MediaCodecVideoEncoder::Encode(
}
const bool key_frame =
frame_types->front() != kVideoFrameDelta || send_key_frame;
frame_types->front() != VideoFrameType::kVideoFrameDelta ||
send_key_frame;
bool encode_status = true;
int j_input_buffer_index = -1;
@ -1009,7 +1010,8 @@ bool MediaCodecVideoEncoder::DeliverPendingOutputs(JNIEnv* jni) {
? VideoContentType::SCREENSHARE
: VideoContentType::UNSPECIFIED;
image->timing_.flags = VideoSendTiming::kInvalid;
image->_frameType = (key_frame ? kVideoFrameKey : kVideoFrameDelta);
image->_frameType = (key_frame ? VideoFrameType::kVideoFrameKey
: VideoFrameType::kVideoFrameDelta);
image->_completeFrame = true;
CodecSpecificInfo info;
memset(&info, 0, sizeof(info));

View File

@ -21,7 +21,7 @@ namespace jni {
ScopedJavaLocalRef<jobject> NativeToJavaFrameType(JNIEnv* env,
VideoFrameType frame_type) {
return Java_FrameType_fromNativeIndex(env, frame_type);
return Java_FrameType_fromNativeIndex(env, static_cast<int>(frame_type));
}
ScopedJavaLocalRef<jobject> NativeToJavaEncodedImage(

View File

@ -14,7 +14,7 @@
#include <jni.h>
#include <vector>
#include "common_types.h" // NOLINT(build/include)
#include "api/video/video_frame_type.h"
#include "sdk/android/native_api/jni/scoped_java_ref.h"

View File

@ -383,7 +383,7 @@ int VideoEncoderWrapper::ParseQp(const std::vector<uint8_t>& buffer) {
CodecSpecificInfo VideoEncoderWrapper::ParseCodecSpecificInfo(
const EncodedImage& frame) {
const bool key_frame = frame._frameType == kVideoFrameKey;
const bool key_frame = frame._frameType == VideoFrameType::kVideoFrameKey;
CodecSpecificInfo info;
info.codecType = codec_settings_.codecType;