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

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
« media/base/video_decoder.h ('K') | « media/base/video_decoder.h ('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 base::ResetAndReturn(&decode_cb_).Run(kOk);
361 } 361 }
362 362
363 bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer, 363 bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer,
364 scoped_refptr<VideoFrame>* video_frame) { 364 scoped_refptr<VideoFrame>* video_frame) {
365 DCHECK(video_frame); 365 DCHECK(video_frame);
366 DCHECK(!buffer->end_of_stream()); 366 DCHECK(!buffer->end_of_stream());
367 367
368 // Pass |buffer| to libvpx. 368 // Pass |buffer| to libvpx.
369 int64 timestamp = buffer->timestamp().InMicroseconds(); 369 int64 timestamp = buffer->timestamp().InMicroseconds();
370 void* user_priv = reinterpret_cast<void*>(&timestamp); 370 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()); 502 vpx_image->stride[VPX_PLANE_Y], vpx_image->d_h, video_frame->get());
503 return; 503 return;
504 } 504 }
505 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y], 505 CopyAPlane(vpx_image_alpha->planes[VPX_PLANE_Y],
506 vpx_image->stride[VPX_PLANE_Y], 506 vpx_image->stride[VPX_PLANE_Y],
507 vpx_image->d_h, 507 vpx_image->d_h,
508 video_frame->get()); 508 video_frame->get());
509 } 509 }
510 510
511 } // namespace media 511 } // namespace media
OLDNEW
« media/base/video_decoder.h ('K') | « media/base/video_decoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698