Revert 2660 - updating cl
Adding debug options BUG= Review URL: https://webrtc-codereview.appspot.com/751005 TBR=mikhal@webrtc.org Review URL: https://webrtc-codereview.appspot.com/752007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@2663 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
3387b88595
commit
f7884f9900
@ -544,12 +544,6 @@ public:
|
||||
// < 0, on error.
|
||||
virtual int SetReceiverRobustnessMode(ReceiverRobustness robustnessMode,
|
||||
DecodeErrors errorMode) = 0;
|
||||
|
||||
// Enables recording of debugging information.
|
||||
virtual int StartDebugRecording(const char* file_name_utf8) = 0;
|
||||
|
||||
// Disables recording of debugging information.
|
||||
virtual int StopDebugRecording() = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -21,6 +21,7 @@ namespace webrtc
|
||||
{
|
||||
|
||||
//#define DEBUG_DECODER_BIT_STREAM
|
||||
//#define DEBUG_ENCODER_INPUT
|
||||
|
||||
WebRtc_UWord32
|
||||
VCMProcessTimer::Period() const
|
||||
@ -77,7 +78,10 @@ _nextFrameType(kVideoFrameDelta),
|
||||
_mediaOpt(id, clock_),
|
||||
_sendCodecType(kVideoCodecUnknown),
|
||||
_sendStatsCallback(NULL),
|
||||
#ifdef DEBUG_ENCODER_INPUT
|
||||
_encoderInputFile(NULL),
|
||||
#endif
|
||||
|
||||
_codecDataBase(id),
|
||||
_receiveStatsTimer(1000, clock_),
|
||||
_sendStatsTimer(1000, clock_),
|
||||
@ -88,6 +92,9 @@ _keyRequestTimer(500, clock_)
|
||||
#ifdef DEBUG_DECODER_BIT_STREAM
|
||||
_bitStreamBeforeDecoder = fopen("decoderBitStream.bit", "wb");
|
||||
#endif
|
||||
#ifdef DEBUG_ENCODER_INPUT
|
||||
_encoderInputFile = fopen("encoderInput.yuv", "wb");
|
||||
#endif
|
||||
}
|
||||
|
||||
VideoCodingModuleImpl::~VideoCodingModuleImpl()
|
||||
@ -102,10 +109,9 @@ VideoCodingModuleImpl::~VideoCodingModuleImpl()
|
||||
#ifdef DEBUG_DECODER_BIT_STREAM
|
||||
fclose(_bitStreamBeforeDecoder);
|
||||
#endif
|
||||
if (_encoderInputFile != NULL)
|
||||
{
|
||||
fclose(_encoderInputFile);
|
||||
}
|
||||
#ifdef DEBUG_ENCODER_INPUT
|
||||
fclose(_encoderInputFile);
|
||||
#endif
|
||||
}
|
||||
|
||||
VideoCodingModule*
|
||||
@ -680,6 +686,7 @@ VideoCodingModuleImpl::AddVideoFrame(const VideoFrame& videoFrame,
|
||||
WebRtc_Word32 ret = _encoder->Encode(videoFrame,
|
||||
codecSpecificInfo,
|
||||
_nextFrameType);
|
||||
#ifdef DEBUG_ENCODER_INPUT
|
||||
if (_encoderInputFile != NULL)
|
||||
{
|
||||
if (fwrite(videoFrame.Buffer(), 1, videoFrame.Length(),
|
||||
@ -687,6 +694,7 @@ VideoCodingModuleImpl::AddVideoFrame(const VideoFrame& videoFrame,
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (ret < 0)
|
||||
{
|
||||
WEBRTC_TRACE(webrtc::kTraceError,
|
||||
@ -1366,19 +1374,4 @@ int VideoCodingModuleImpl::SetReceiverRobustnessMode(
|
||||
return VCM_OK;
|
||||
}
|
||||
|
||||
int VideoCodingModuleImpl::StartDebugRecording(const char* file_name_utf8) {
|
||||
_encoderInputFile = fopen(file_name_utf8, "wb");
|
||||
if (_encoderInputFile == NULL)
|
||||
return VCM_GENERAL_ERROR;
|
||||
return VCM_OK;
|
||||
}
|
||||
|
||||
int VideoCodingModuleImpl::StopDebugRecording(){
|
||||
if (_encoderInputFile != NULL) {
|
||||
fclose(_encoderInputFile);
|
||||
_encoderInputFile = NULL;
|
||||
}
|
||||
return VCM_OK;
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
@ -259,11 +259,6 @@ public:
|
||||
// Set the receiver robustness mode.
|
||||
virtual int SetReceiverRobustnessMode(ReceiverRobustness robustnessMode,
|
||||
DecodeErrors errorMode);
|
||||
// Enables recording of debugging information.
|
||||
virtual int StartDebugRecording(const char* file_name_utf8);
|
||||
|
||||
// Disables recording of debugging information.
|
||||
virtual int StopDebugRecording();
|
||||
|
||||
protected:
|
||||
WebRtc_Word32 Decode(const webrtc::VCMEncodedFrame& frame);
|
||||
@ -304,7 +299,10 @@ private:
|
||||
VCMMediaOptimization _mediaOpt;
|
||||
VideoCodecType _sendCodecType;
|
||||
VCMSendStatisticsCallback* _sendStatsCallback;
|
||||
#ifdef DEBUG_ENCODER_INPUT
|
||||
FILE* _encoderInputFile;
|
||||
#endif
|
||||
|
||||
VCMCodecDataBase _codecDataBase;
|
||||
VCMProcessTimer _receiveStatsTimer;
|
||||
VCMProcessTimer _sendStatsTimer;
|
||||
|
@ -165,11 +165,6 @@ class WEBRTC_DLLEXPORT ViECodec {
|
||||
// decode the incoming video stream.
|
||||
virtual int WaitForFirstKeyFrame(const int video_channel,
|
||||
const bool wait) = 0;
|
||||
// Enables recording of debugging information.
|
||||
virtual int StartDebugRecording(int video_channel,
|
||||
const char* file_name_utf8) = 0;
|
||||
// Disables recording of debugging information.
|
||||
virtual int StopDebugRecording(int video_channel) = 0;
|
||||
|
||||
protected:
|
||||
ViECodec() {}
|
||||
|
@ -226,10 +226,6 @@ void ViEAutoTest::ViECodecStandardTest() {
|
||||
ViETest::Log("Done!");
|
||||
}
|
||||
|
||||
// Test debug information recording.
|
||||
EXPECT_EQ(0, codec->StartDebugRecording(video_channel,
|
||||
"vie_autotest_debug"));
|
||||
|
||||
// Test Callbacks
|
||||
TestCodecObserver codec_observer;
|
||||
EXPECT_EQ(0, codec->RegisterEncoderObserver(video_channel, codec_observer));
|
||||
@ -254,9 +250,6 @@ void ViEAutoTest::ViECodecStandardTest() {
|
||||
EXPECT_GT(codec_observer.incoming_rate_called_, 0);
|
||||
EXPECT_GT(codec_observer.outgoing_rate_called_, 0);
|
||||
|
||||
// Stop debug record.
|
||||
EXPECT_EQ(0, codec->StopDebugRecording(video_channel));
|
||||
|
||||
EXPECT_EQ(0, base->StopReceive(video_channel));
|
||||
EXPECT_EQ(0, render->StopRender(video_channel));
|
||||
EXPECT_EQ(0, render->RemoveRenderer(capture_id));
|
||||
|
@ -654,30 +654,6 @@ int ViECodecImpl::WaitForFirstKeyFrame(const int video_channel,
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int ViECodecImpl::StartDebugRecording(int video_channel,
|
||||
const char* file_name_utf8) {
|
||||
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
|
||||
ViEEncoder* vie_encoder = cs.Encoder(video_channel);
|
||||
if (!vie_encoder) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"%s: No encoder %d", __FUNCTION__, video_channel);
|
||||
return -1;
|
||||
}
|
||||
return vie_encoder->StartDebugRecording(file_name_utf8);
|
||||
}
|
||||
|
||||
int ViECodecImpl::StopDebugRecording(int video_channel) {
|
||||
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
|
||||
ViEEncoder* vie_encoder = cs.Encoder(video_channel);
|
||||
if (!vie_encoder) {
|
||||
WEBRTC_TRACE(kTraceError, kTraceVideo,
|
||||
ViEId(shared_data_->instance_id(), video_channel),
|
||||
"%s: No encoder %d", __FUNCTION__, video_channel);
|
||||
return -1;
|
||||
}
|
||||
return vie_encoder->StopDebugRecording();
|
||||
}
|
||||
|
||||
bool ViECodecImpl::CodecValid(const VideoCodec& video_codec) {
|
||||
// Check pl_name matches codec_type.
|
||||
|
@ -65,11 +65,6 @@ class ViECodecImpl
|
||||
virtual int DeregisterDecoderObserver(const int video_channel);
|
||||
virtual int SendKeyFrame(const int video_channel);
|
||||
virtual int WaitForFirstKeyFrame(const int video_channel, const bool wait);
|
||||
// Enables recording of debugging information.
|
||||
virtual int StartDebugRecording(int video_channel,
|
||||
const char* file_name_utf8);
|
||||
// Disables recording of debugging information.
|
||||
virtual int StopDebugRecording(int video_channel);
|
||||
|
||||
protected:
|
||||
explicit ViECodecImpl(ViESharedData* shared_data);
|
||||
|
@ -868,14 +868,6 @@ ViEFileRecorder& ViEEncoder::GetOutgoingFileRecorder() {
|
||||
return file_recorder_;
|
||||
}
|
||||
|
||||
int ViEEncoder::StartDebugRecording(const char* fileNameUTF8) {
|
||||
return vcm_.StartDebugRecording(fileNameUTF8);
|
||||
}
|
||||
|
||||
int ViEEncoder::StopDebugRecording() {
|
||||
return vcm_.StopDebugRecording();
|
||||
}
|
||||
|
||||
QMVideoSettingsCallback::QMVideoSettingsCallback(VideoProcessingModule* vpm)
|
||||
: vpm_(vpm) {
|
||||
}
|
||||
|
@ -142,11 +142,6 @@ class ViEEncoder
|
||||
|
||||
// Recording.
|
||||
ViEFileRecorder& GetOutgoingFileRecorder();
|
||||
// Enables recording of debugging information.
|
||||
virtual int StartDebugRecording(const char* fileNameUTF8);
|
||||
|
||||
// Disables recording of debugging information.
|
||||
virtual int StopDebugRecording();
|
||||
|
||||
protected:
|
||||
// Called by BitrateObserver.
|
||||
|
Loading…
Reference in New Issue
Block a user