| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/receiver/video_decoder.h" | 5 #include "media/cast/receiver/video_decoder.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
| 11 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
| 12 #include "base/location.h" | 13 #include "base/location.h" |
| 13 #include "base/logging.h" | 14 #include "base/logging.h" |
| 14 #include "base/macros.h" | 15 #include "base/macros.h" |
| 15 #include "base/values.h" | 16 #include "base/values.h" |
| 16 #include "media/base/video_frame_pool.h" | 17 #include "media/base/video_frame_pool.h" |
| 17 #include "media/base/video_util.h" | 18 #include "media/base/video_util.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 const scoped_refptr<VideoFrame> decoded_frame = Decode( | 66 const scoped_refptr<VideoFrame> decoded_frame = Decode( |
| 66 encoded_frame->mutable_bytes(), | 67 encoded_frame->mutable_bytes(), |
| 67 static_cast<int>(encoded_frame->data.size())); | 68 static_cast<int>(encoded_frame->data.size())); |
| 68 | 69 |
| 69 scoped_ptr<FrameEvent> decode_event(new FrameEvent()); | 70 scoped_ptr<FrameEvent> decode_event(new FrameEvent()); |
| 70 decode_event->timestamp = cast_environment_->Clock()->NowTicks(); | 71 decode_event->timestamp = cast_environment_->Clock()->NowTicks(); |
| 71 decode_event->type = FRAME_DECODED; | 72 decode_event->type = FRAME_DECODED; |
| 72 decode_event->media_type = VIDEO_EVENT; | 73 decode_event->media_type = VIDEO_EVENT; |
| 73 decode_event->rtp_timestamp = encoded_frame->rtp_timestamp; | 74 decode_event->rtp_timestamp = encoded_frame->rtp_timestamp; |
| 74 decode_event->frame_id = encoded_frame->frame_id; | 75 decode_event->frame_id = encoded_frame->frame_id; |
| 75 cast_environment_->logger()->DispatchFrameEvent(decode_event.Pass()); | 76 cast_environment_->logger()->DispatchFrameEvent(std::move(decode_event)); |
| 76 | 77 |
| 77 cast_environment_->PostTask( | 78 cast_environment_->PostTask( |
| 78 CastEnvironment::MAIN, | 79 CastEnvironment::MAIN, |
| 79 FROM_HERE, | 80 FROM_HERE, |
| 80 base::Bind(callback, decoded_frame, is_continuous)); | 81 base::Bind(callback, decoded_frame, is_continuous)); |
| 81 } | 82 } |
| 82 | 83 |
| 83 protected: | 84 protected: |
| 84 friend class base::RefCountedThreadSafe<ImplBase>; | 85 friend class base::RefCountedThreadSafe<ImplBase>; |
| 85 virtual ~ImplBase() {} | 86 virtual ~ImplBase() {} |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 cast_environment_->PostTask(CastEnvironment::VIDEO, | 269 cast_environment_->PostTask(CastEnvironment::VIDEO, |
| 269 FROM_HERE, | 270 FROM_HERE, |
| 270 base::Bind(&VideoDecoder::ImplBase::DecodeFrame, | 271 base::Bind(&VideoDecoder::ImplBase::DecodeFrame, |
| 271 impl_, | 272 impl_, |
| 272 base::Passed(&encoded_frame), | 273 base::Passed(&encoded_frame), |
| 273 callback)); | 274 callback)); |
| 274 } | 275 } |
| 275 | 276 |
| 276 } // namespace cast | 277 } // namespace cast |
| 277 } // namespace media | 278 } // namespace media |
| OLD | NEW |