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

Side by Side Diff: media/filters/vpx_video_decoder.cc

Issue 805193006: Fix VideoDecoderShim to return correct decode_id for all codecs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/vpx_video_decoder.h" 5 #include "media/filters/vpx_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 return; 347 return;
348 } 348 }
349 349
350 scoped_refptr<VideoFrame> video_frame; 350 scoped_refptr<VideoFrame> video_frame;
351 if (!VpxDecode(buffer, &video_frame)) { 351 if (!VpxDecode(buffer, &video_frame)) {
352 state_ = kError; 352 state_ = kError;
353 base::ResetAndReturn(&decode_cb_).Run(kDecodeError); 353 base::ResetAndReturn(&decode_cb_).Run(kDecodeError);
354 return; 354 return;
355 } 355 }
356 356
357 base::ResetAndReturn(&decode_cb_).Run(kOk);
358
359 if (video_frame.get()) 357 if (video_frame.get())
360 output_cb_.Run(video_frame); 358 output_cb_.Run(video_frame);
359
360 // VideoDecoderShim expects that |decode_cb| is called only after
361 // |output_cb_|.
362 base::ResetAndReturn(&decode_cb_).Run(kOk);
361 } 363 }
362 364
363 bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer, 365 bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer,
364 scoped_refptr<VideoFrame>* video_frame) { 366 scoped_refptr<VideoFrame>* video_frame) {
365 DCHECK(video_frame); 367 DCHECK(video_frame);
366 DCHECK(!buffer->end_of_stream()); 368 DCHECK(!buffer->end_of_stream());
367 369
368 // Pass |buffer| to libvpx. 370 // Pass |buffer| to libvpx.
369 int64 timestamp = buffer->timestamp().InMicroseconds(); 371 int64 timestamp = buffer->timestamp().InMicroseconds();
370 void* user_priv = reinterpret_cast<void*>(&timestamp); 372 void* user_priv = reinterpret_cast<void*>(&timestamp);
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get()); 504 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get());
503 return; 505 return;
504 } 506 }
505 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], 507 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y],
506 vpx_image->stride[VPX_PLANE_Y], 508 vpx_image->stride[VPX_PLANE_Y],
507 vpx_image->d_h, 509 vpx_image->d_h,
508 video_frame->get()); 510 video_frame->get());
509 } 511 }
510 512
511 } // namespace media 513 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698