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:
henrike@webrtc.org 2012-08-25 02:00:19 +00:00
parent 3387b88595
commit f7884f9900
9 changed files with 15 additions and 84 deletions

View File

@ -544,12 +544,6 @@ public:
// < 0, on error. // < 0, on error.
virtual int SetReceiverRobustnessMode(ReceiverRobustness robustnessMode, virtual int SetReceiverRobustnessMode(ReceiverRobustness robustnessMode,
DecodeErrors errorMode) = 0; 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 } // namespace webrtc

View File

@ -21,6 +21,7 @@ namespace webrtc
{ {
//#define DEBUG_DECODER_BIT_STREAM //#define DEBUG_DECODER_BIT_STREAM
//#define DEBUG_ENCODER_INPUT
WebRtc_UWord32 WebRtc_UWord32
VCMProcessTimer::Period() const VCMProcessTimer::Period() const
@ -77,7 +78,10 @@ _nextFrameType(kVideoFrameDelta),
_mediaOpt(id, clock_), _mediaOpt(id, clock_),
_sendCodecType(kVideoCodecUnknown), _sendCodecType(kVideoCodecUnknown),
_sendStatsCallback(NULL), _sendStatsCallback(NULL),
#ifdef DEBUG_ENCODER_INPUT
_encoderInputFile(NULL), _encoderInputFile(NULL),
#endif
_codecDataBase(id), _codecDataBase(id),
_receiveStatsTimer(1000, clock_), _receiveStatsTimer(1000, clock_),
_sendStatsTimer(1000, clock_), _sendStatsTimer(1000, clock_),
@ -88,6 +92,9 @@ _keyRequestTimer(500, clock_)
#ifdef DEBUG_DECODER_BIT_STREAM #ifdef DEBUG_DECODER_BIT_STREAM
_bitStreamBeforeDecoder = fopen("decoderBitStream.bit", "wb"); _bitStreamBeforeDecoder = fopen("decoderBitStream.bit", "wb");
#endif #endif
#ifdef DEBUG_ENCODER_INPUT
_encoderInputFile = fopen("encoderInput.yuv", "wb");
#endif
} }
VideoCodingModuleImpl::~VideoCodingModuleImpl() VideoCodingModuleImpl::~VideoCodingModuleImpl()
@ -102,10 +109,9 @@ VideoCodingModuleImpl::~VideoCodingModuleImpl()
#ifdef DEBUG_DECODER_BIT_STREAM #ifdef DEBUG_DECODER_BIT_STREAM
fclose(_bitStreamBeforeDecoder); fclose(_bitStreamBeforeDecoder);
#endif #endif
if (_encoderInputFile != NULL) #ifdef DEBUG_ENCODER_INPUT
{
fclose(_encoderInputFile); fclose(_encoderInputFile);
} #endif
} }
VideoCodingModule* VideoCodingModule*
@ -680,6 +686,7 @@ VideoCodingModuleImpl::AddVideoFrame(const VideoFrame& videoFrame,
WebRtc_Word32 ret = _encoder->Encode(videoFrame, WebRtc_Word32 ret = _encoder->Encode(videoFrame,
codecSpecificInfo, codecSpecificInfo,
_nextFrameType); _nextFrameType);
#ifdef DEBUG_ENCODER_INPUT
if (_encoderInputFile != NULL) if (_encoderInputFile != NULL)
{ {
if (fwrite(videoFrame.Buffer(), 1, videoFrame.Length(), if (fwrite(videoFrame.Buffer(), 1, videoFrame.Length(),
@ -687,6 +694,7 @@ VideoCodingModuleImpl::AddVideoFrame(const VideoFrame& videoFrame,
return -1; return -1;
} }
} }
#endif
if (ret < 0) if (ret < 0)
{ {
WEBRTC_TRACE(webrtc::kTraceError, WEBRTC_TRACE(webrtc::kTraceError,
@ -1366,19 +1374,4 @@ int VideoCodingModuleImpl::SetReceiverRobustnessMode(
return VCM_OK; 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 } // namespace webrtc

View File

@ -259,11 +259,6 @@ public:
// Set the receiver robustness mode. // Set the receiver robustness mode.
virtual int SetReceiverRobustnessMode(ReceiverRobustness robustnessMode, virtual int SetReceiverRobustnessMode(ReceiverRobustness robustnessMode,
DecodeErrors errorMode); DecodeErrors errorMode);
// Enables recording of debugging information.
virtual int StartDebugRecording(const char* file_name_utf8);
// Disables recording of debugging information.
virtual int StopDebugRecording();
protected: protected:
WebRtc_Word32 Decode(const webrtc::VCMEncodedFrame& frame); WebRtc_Word32 Decode(const webrtc::VCMEncodedFrame& frame);
@ -304,7 +299,10 @@ private:
VCMMediaOptimization _mediaOpt; VCMMediaOptimization _mediaOpt;
VideoCodecType _sendCodecType; VideoCodecType _sendCodecType;
VCMSendStatisticsCallback* _sendStatsCallback; VCMSendStatisticsCallback* _sendStatsCallback;
#ifdef DEBUG_ENCODER_INPUT
FILE* _encoderInputFile; FILE* _encoderInputFile;
#endif
VCMCodecDataBase _codecDataBase; VCMCodecDataBase _codecDataBase;
VCMProcessTimer _receiveStatsTimer; VCMProcessTimer _receiveStatsTimer;
VCMProcessTimer _sendStatsTimer; VCMProcessTimer _sendStatsTimer;

View File

@ -165,11 +165,6 @@ class WEBRTC_DLLEXPORT ViECodec {
// decode the incoming video stream. // decode the incoming video stream.
virtual int WaitForFirstKeyFrame(const int video_channel, virtual int WaitForFirstKeyFrame(const int video_channel,
const bool wait) = 0; 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: protected:
ViECodec() {} ViECodec() {}

View File

@ -226,10 +226,6 @@ void ViEAutoTest::ViECodecStandardTest() {
ViETest::Log("Done!"); ViETest::Log("Done!");
} }
// Test debug information recording.
EXPECT_EQ(0, codec->StartDebugRecording(video_channel,
"vie_autotest_debug"));
// Test Callbacks // Test Callbacks
TestCodecObserver codec_observer; TestCodecObserver codec_observer;
EXPECT_EQ(0, codec->RegisterEncoderObserver(video_channel, 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.incoming_rate_called_, 0);
EXPECT_GT(codec_observer.outgoing_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, base->StopReceive(video_channel));
EXPECT_EQ(0, render->StopRender(video_channel)); EXPECT_EQ(0, render->StopRender(video_channel));
EXPECT_EQ(0, render->RemoveRenderer(capture_id)); EXPECT_EQ(0, render->RemoveRenderer(capture_id));

View File

@ -654,30 +654,6 @@ int ViECodecImpl::WaitForFirstKeyFrame(const int video_channel,
} }
return 0; 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) { bool ViECodecImpl::CodecValid(const VideoCodec& video_codec) {
// Check pl_name matches codec_type. // Check pl_name matches codec_type.

View File

@ -65,11 +65,6 @@ class ViECodecImpl
virtual int DeregisterDecoderObserver(const int video_channel); virtual int DeregisterDecoderObserver(const int video_channel);
virtual int SendKeyFrame(const int video_channel); virtual int SendKeyFrame(const int video_channel);
virtual int WaitForFirstKeyFrame(const int video_channel, const bool wait); 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: protected:
explicit ViECodecImpl(ViESharedData* shared_data); explicit ViECodecImpl(ViESharedData* shared_data);

View File

@ -868,14 +868,6 @@ ViEFileRecorder& ViEEncoder::GetOutgoingFileRecorder() {
return file_recorder_; return file_recorder_;
} }
int ViEEncoder::StartDebugRecording(const char* fileNameUTF8) {
return vcm_.StartDebugRecording(fileNameUTF8);
}
int ViEEncoder::StopDebugRecording() {
return vcm_.StopDebugRecording();
}
QMVideoSettingsCallback::QMVideoSettingsCallback(VideoProcessingModule* vpm) QMVideoSettingsCallback::QMVideoSettingsCallback(VideoProcessingModule* vpm)
: vpm_(vpm) { : vpm_(vpm) {
} }

View File

@ -142,11 +142,6 @@ class ViEEncoder
// Recording. // Recording.
ViEFileRecorder& GetOutgoingFileRecorder(); ViEFileRecorder& GetOutgoingFileRecorder();
// Enables recording of debugging information.
virtual int StartDebugRecording(const char* fileNameUTF8);
// Disables recording of debugging information.
virtual int StopDebugRecording();
protected: protected:
// Called by BitrateObserver. // Called by BitrateObserver.