Add EncodedImageCallback::OnEncodedImage().

OnEncodedImage() is going to replace Encoded(), which is deprecated now.
The new OnEncodedImage() returns Result struct that contains frame_id,
which tells the encoder RTP timestamp for the frame.

BUG=chromium:621691
R=niklas.enbom@webrtc.org, sprang@webrtc.org, stefan@webrtc.org

Review URL: https://codereview.webrtc.org/2089773002 .

Committed: https://crrev.com/4c7f4cd2ef76821edca6d773d733a924b0bedd25
Committed: https://crrev.com/ad34dbe934d47f88011045671b4aea00dbd5a795
Cr-Original-Original-Commit-Position: refs/heads/master@{#13613}
Cr-Original-Commit-Position: refs/heads/master@{#13615}
Cr-Commit-Position: refs/heads/master@{#13617}
This commit is contained in:
Sergey Ulanov
2016-08-02 17:46:41 -07:00
parent 51db4dd1bd
commit 525df3ffd1
43 changed files with 477 additions and 382 deletions

View File

@ -45,7 +45,8 @@ namespace {
class EncodedImageCallbackWrapper : public EncodedImageCallback {
public:
EncodedImageCallbackWrapper()
: cs_(CriticalSectionWrapper::CreateCriticalSection()), callback_(NULL) {}
: cs_(CriticalSectionWrapper::CreateCriticalSection()),
callback_(nullptr) {}
virtual ~EncodedImageCallbackWrapper() {}
@ -54,14 +55,15 @@ class EncodedImageCallbackWrapper : public EncodedImageCallback {
callback_ = callback;
}
virtual int32_t Encoded(const EncodedImage& encoded_image,
const CodecSpecificInfo* codec_specific_info,
const RTPFragmentationHeader* fragmentation) {
virtual Result OnEncodedImage(const EncodedImage& encoded_image,
const CodecSpecificInfo* codec_specific_info,
const RTPFragmentationHeader* fragmentation) {
CriticalSectionScoped cs(cs_.get());
if (callback_)
return callback_->Encoded(encoded_image, codec_specific_info,
fragmentation);
return 0;
if (callback_) {
return callback_->OnEncodedImage(encoded_image, codec_specific_info,
fragmentation);
}
return Result(Result::ERROR_SEND_FAILED);
}
private: