Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Unified Diff: media/filters/vpx_video_decoder.cc

Issue 17408005: Refactored DecoderBuffer to use unix_hacker_style naming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@localrefactor
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/video_frame_stream_unittest.cc ('k') | media/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/vpx_video_decoder.cc
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index 7b8f011e6e95c1ef0060437c25c7a5cf8cadf97f..9880eda0a50a29904a3833c33472df5af15f23fa 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -222,7 +222,7 @@ void VpxVideoDecoder::DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer) {
DCHECK(buffer);
// Transition to kDecodeFinished on the first end of stream buffer.
- if (state_ == kNormal && buffer->IsEndOfStream()) {
+ if (state_ == kNormal && buffer->end_of_stream()) {
state_ = kDecodeFinished;
base::ResetAndReturn(&read_cb_).Run(kOk, VideoFrame::CreateEmptyFrame());
return;
@@ -235,6 +235,7 @@ void VpxVideoDecoder::DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer) {
return;
}
+ // If we didn't get a frame we need more data.
if (!video_frame.get()) {
base::ResetAndReturn(&read_cb_).Run(kNotEnoughData, NULL);
return;
@@ -246,14 +247,14 @@ void VpxVideoDecoder::DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer) {
bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer,
scoped_refptr<VideoFrame>* video_frame) {
DCHECK(video_frame);
- DCHECK(!buffer->IsEndOfStream());
+ DCHECK(!buffer->end_of_stream());
// Pass |buffer| to libvpx.
- int64 timestamp = buffer->GetTimestamp().InMicroseconds();
+ int64 timestamp = buffer->timestamp().InMicroseconds();
void* user_priv = reinterpret_cast<void*>(&timestamp);
vpx_codec_err_t status = vpx_codec_decode(vpx_codec_,
- buffer->GetData(),
- buffer->GetDataSize(),
+ buffer->data(),
+ buffer->data_size(),
user_priv,
0);
if (status != VPX_CODEC_OK) {
@@ -275,18 +276,18 @@ bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer,
}
const vpx_image_t* vpx_image_alpha = NULL;
- if (vpx_codec_alpha_ && buffer->GetSideDataSize() >= 8) {
+ if (vpx_codec_alpha_ && buffer->side_data_size() >= 8) {
// Pass alpha data to libvpx.
- int64 timestamp_alpha = buffer->GetTimestamp().InMicroseconds();
+ int64 timestamp_alpha = buffer->timestamp().InMicroseconds();
void* user_priv_alpha = reinterpret_cast<void*>(&timestamp_alpha);
// First 8 bytes of side data is side_data_id in big endian.
const uint64 side_data_id = base::NetToHost64(
- *(reinterpret_cast<const uint64*>(buffer->GetSideData())));
+ *(reinterpret_cast<const uint64*>(buffer->side_data())));
if (side_data_id == 1) {
status = vpx_codec_decode(vpx_codec_alpha_,
- buffer->GetSideData() + 8,
- buffer->GetSideDataSize() - 8,
+ buffer->side_data() + 8,
+ buffer->side_data_size() - 8,
user_priv_alpha,
0);
« no previous file with comments | « media/filters/video_frame_stream_unittest.cc ('k') | media/mp4/mp4_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698