OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/cast/video_receiver/codecs/vp8/vp8_decoder.h" | 5 #include "media/cast/video_receiver/codecs/vp8/vp8_decoder.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "third_party/libvpx/source/libvpx/vpx/vp8dx.h" | 10 #include "third_party/libvpx/source/libvpx/vpx/vp8dx.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 memcpy(decoded_frame->u_plane.data, img->planes[VPX_PLANE_U], | 77 memcpy(decoded_frame->u_plane.data, img->planes[VPX_PLANE_U], |
78 decoded_frame->u_plane.length); | 78 decoded_frame->u_plane.length); |
79 | 79 |
80 decoded_frame->v_plane.stride = img->stride[VPX_PLANE_V]; | 80 decoded_frame->v_plane.stride = img->stride[VPX_PLANE_V]; |
81 decoded_frame->v_plane.length = img->stride[VPX_PLANE_V] * (img->d_h + 1) / 2; | 81 decoded_frame->v_plane.length = img->stride[VPX_PLANE_V] * (img->d_h + 1) / 2; |
82 decoded_frame->v_plane.data = new uint8[decoded_frame->v_plane.length]; | 82 decoded_frame->v_plane.data = new uint8[decoded_frame->v_plane.length]; |
83 | 83 |
84 memcpy(decoded_frame->v_plane.data, img->planes[VPX_PLANE_V], | 84 memcpy(decoded_frame->v_plane.data, img->planes[VPX_PLANE_V], |
85 decoded_frame->v_plane.length); | 85 decoded_frame->v_plane.length); |
86 | 86 |
87 // Return frame. | 87 cast_environment_->Logging()->InsertFrameEvent(kVideoFrameDecoded, |
| 88 kFrameIdUnknown, encoded_frame->frame_id); |
88 VLOG(1) << "Decoded frame " << frame_id_int; | 89 VLOG(1) << "Decoded frame " << frame_id_int; |
| 90 |
89 // Frame decoded - return frame to the user via callback. | 91 // Frame decoded - return frame to the user via callback. |
90 cast_environment_->PostTask(CastEnvironment::MAIN, FROM_HERE, | 92 cast_environment_->PostTask(CastEnvironment::MAIN, FROM_HERE, |
91 base::Bind(frame_decoded_cb, base::Passed(&decoded_frame), render_time)); | 93 base::Bind(frame_decoded_cb, base::Passed(&decoded_frame), render_time)); |
92 | 94 |
93 return true; | 95 return true; |
94 } | 96 } |
95 | 97 |
96 } // namespace cast | 98 } // namespace cast |
97 } // namespace media | 99 } // namespace media |
98 | 100 |
OLD | NEW |