Remove EncodedFrameCallbackAdapter.

EncodedFrameCallbackAdapter was used VideoSendStream and
VideoReceiveStream, but there is no reason to have it as these classes
can call EncodedFrameObserver directly.

Review-Url: https://codereview.webrtc.org/2068463004
Cr-Commit-Position: refs/heads/master@{#13145}
This commit is contained in:
sergeyu 2016-06-14 15:29:37 -07:00 committed by Commit bot
parent 204177f967
commit 37ad337848
8 changed files with 9 additions and 91 deletions

View File

@ -13,8 +13,6 @@ source_set("video") {
sources = [
"call_stats.cc",
"call_stats.h",
"encoded_frame_callback_adapter.cc",
"encoded_frame_callback_adapter.h",
"encoder_state_feedback.cc",
"encoder_state_feedback.h",
"overuse_frame_detector.cc",

View File

@ -1,39 +0,0 @@
/*
* Copyright (c) 2013 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.
*/
#include "webrtc/video/encoded_frame_callback_adapter.h"
#include "webrtc/base/checks.h"
#include "webrtc/modules/video_coding/encoded_frame.h"
namespace webrtc {
namespace internal {
EncodedFrameCallbackAdapter::EncodedFrameCallbackAdapter(
EncodedFrameObserver* observer) : observer_(observer) {
}
EncodedFrameCallbackAdapter::~EncodedFrameCallbackAdapter() {}
int32_t EncodedFrameCallbackAdapter::Encoded(
const EncodedImage& encodedImage,
const CodecSpecificInfo* codecSpecificInfo,
const RTPFragmentationHeader* fragmentation) {
if (!observer_)
return 0;
const EncodedFrame frame(encodedImage._buffer, encodedImage._length,
encodedImage._frameType);
observer_->EncodedFrameCallback(frame);
return 0;
}
} // namespace internal
} // namespace webrtc

View File

@ -1,36 +0,0 @@
/*
* Copyright (c) 2013 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.
*/
#ifndef WEBRTC_VIDEO_ENCODED_FRAME_CALLBACK_ADAPTER_H_
#define WEBRTC_VIDEO_ENCODED_FRAME_CALLBACK_ADAPTER_H_
#include "webrtc/common_video/include/frame_callback.h"
#include "webrtc/modules/video_coding/include/video_codec_interface.h"
namespace webrtc {
namespace internal {
class EncodedFrameCallbackAdapter : public EncodedImageCallback {
public:
explicit EncodedFrameCallbackAdapter(EncodedFrameObserver* observer);
virtual ~EncodedFrameCallbackAdapter();
virtual int32_t Encoded(const EncodedImage& encodedImage,
const CodecSpecificInfo* codecSpecificInfo,
const RTPFragmentationHeader* fragmentation);
private:
EncodedFrameObserver* const observer_;
};
} // namespace internal
} // namespace webrtc
#endif // WEBRTC_VIDEO_ENCODED_FRAME_CALLBACK_ADAPTER_H_

View File

@ -179,7 +179,6 @@ VideoReceiveStream::VideoReceiveStream(
CallStats* call_stats,
VieRemb* remb)
: transport_adapter_(config.rtcp_send_transport),
encoded_frame_proxy_(config.pre_decode_callback),
config_(std::move(config)),
process_thread_(process_thread),
clock_(Clock::GetRealTimeClock()),
@ -340,9 +339,9 @@ int32_t VideoReceiveStream::Encoded(
const RTPFragmentationHeader* fragmentation) {
stats_proxy_.OnPreDecode(encoded_image, codec_specific_info);
if (config_.pre_decode_callback) {
// TODO(asapersson): Remove EncodedFrameCallbackAdapter.
encoded_frame_proxy_.Encoded(
encoded_image, codec_specific_info, fragmentation);
config_.pre_decode_callback->EncodedFrameCallback(
EncodedFrame(encoded_image._buffer, encoded_image._length,
encoded_image._frameType));
}
if (kEnableFrameRecording) {
if (!ivf_writer_.get()) {

View File

@ -20,7 +20,6 @@
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_coding/video_coding_impl.h"
#include "webrtc/system_wrappers/include/clock.h"
#include "webrtc/video/encoded_frame_callback_adapter.h"
#include "webrtc/video/receive_statistics_proxy.h"
#include "webrtc/video/rtp_stream_receiver.h"
#include "webrtc/video/video_stream_decoder.h"
@ -87,7 +86,6 @@ class VideoReceiveStream : public webrtc::VideoReceiveStream,
void Decode();
TransportAdapter transport_adapter_;
EncodedFrameCallbackAdapter encoded_frame_proxy_;
const VideoReceiveStream::Config config_;
ProcessThread* const process_thread_;
Clock* const clock_;

View File

@ -362,7 +362,6 @@ VideoSendStream::VideoSendStream(
: stats_proxy_(Clock::GetRealTimeClock(),
config,
encoder_config.content_type),
encoded_frame_proxy_(config.post_encode_callback),
config_(config),
suspended_ssrcs_(suspended_ssrcs),
module_process_thread_(module_process_thread),
@ -630,9 +629,12 @@ void VideoSendStream::NormalUsage() {
int32_t VideoSendStream::Encoded(const EncodedImage& encoded_image,
const CodecSpecificInfo* codec_specific_info,
const RTPFragmentationHeader* fragmentation) {
// |encoded_frame_proxy_| forwards frames to |config_.post_encode_callback|;
encoded_frame_proxy_.Encoded(encoded_image, codec_specific_info,
fragmentation);
if (config_.post_encode_callback) {
config_.post_encode_callback->EncodedFrameCallback(
EncodedFrame(encoded_image._buffer, encoded_image._length,
encoded_image._frameType));
}
protection_bitrate_calculator_.UpdateWithEncodedData(encoded_image);
int32_t return_value = payload_router_.Encoded(
encoded_image, codec_specific_info, fragmentation);

View File

@ -20,7 +20,6 @@
#include "webrtc/call.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/video_coding/protection_bitrate_calculator.h"
#include "webrtc/video/encoded_frame_callback_adapter.h"
#include "webrtc/video/encoder_state_feedback.h"
#include "webrtc/video/payload_router.h"
#include "webrtc/video/send_delay_stats.h"
@ -121,7 +120,6 @@ class VideoSendStream : public webrtc::VideoSendStream,
void ConfigureSsrcs();
SendStatisticsProxy stats_proxy_;
EncodedFrameCallbackAdapter encoded_frame_proxy_;
const VideoSendStream::Config config_;
std::map<uint32_t, RtpState> suspended_ssrcs_;

View File

@ -26,8 +26,6 @@
'webrtc_video_sources': [
'video/call_stats.cc',
'video/call_stats.h',
'video/encoded_frame_callback_adapter.cc',
'video/encoded_frame_callback_adapter.h',
'video/encoder_state_feedback.cc',
'video/encoder_state_feedback.h',
'video/overuse_frame_detector.cc',