| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mojo/services/mojo_video_decoder_service.h" | 5 #include "media/mojo/services/mojo_video_decoder_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| 11 #include "media/base/decoder_buffer.h" | 11 #include "media/base/decoder_buffer.h" |
| 12 #include "media/base/video_decoder.h" | 12 #include "media/base/video_decoder.h" |
| 13 #include "media/base/video_decoder_config.h" | 13 #include "media/base/video_decoder_config.h" |
| 14 #include "media/base/video_frame.h" | 14 #include "media/base/video_frame.h" |
| 15 #include "media/mojo/common/media_type_converters.h" | 15 #include "media/mojo/common/media_type_converters.h" |
| 16 #include "media/mojo/common/mojo_decoder_buffer_converter.h" | 16 #include "media/mojo/common/mojo_decoder_buffer_converter.h" |
| 17 #include "media/mojo/services/mojo_media_client.h" | 17 #include "media/mojo/services/mojo_media_client.h" |
| 18 #include "mojo/public/c/system/types.h" | 18 #include "mojo/public/c/system/types.h" |
| 19 #include "mojo/public/cpp/system/buffer.h" | 19 #include "mojo/public/cpp/system/buffer.h" |
| 20 #include "mojo/public/cpp/system/handle.h" | 20 #include "mojo/public/cpp/system/handle.h" |
| 21 | 21 |
| 22 namespace media { | 22 namespace media { |
| 23 | 23 |
| 24 MojoVideoDecoderService::MojoVideoDecoderService( | 24 MojoVideoDecoderService::MojoVideoDecoderService( |
| 25 mojo::InterfaceRequest<mojom::VideoDecoder> request, | |
| 26 MojoMediaClient* mojo_media_client) | 25 MojoMediaClient* mojo_media_client) |
| 27 : binding_(this, std::move(request)), | 26 : mojo_media_client_(mojo_media_client), weak_factory_(this) { |
| 28 mojo_media_client_(mojo_media_client), | |
| 29 weak_factory_(this) { | |
| 30 weak_this_ = weak_factory_.GetWeakPtr(); | 27 weak_this_ = weak_factory_.GetWeakPtr(); |
| 31 } | 28 } |
| 32 | 29 |
| 33 MojoVideoDecoderService::~MojoVideoDecoderService() {} | 30 MojoVideoDecoderService::~MojoVideoDecoderService() {} |
| 34 | 31 |
| 35 void MojoVideoDecoderService::Construct( | 32 void MojoVideoDecoderService::Construct( |
| 36 mojom::VideoDecoderClientPtr client, | 33 mojom::VideoDecoderClientPtr client, |
| 37 mojo::ScopedDataPipeConsumerHandle decoder_buffer_pipe) { | 34 mojo::ScopedDataPipeConsumerHandle decoder_buffer_pipe) { |
| 38 DVLOG(1) << __FUNCTION__; | 35 DVLOG(1) << __FUNCTION__; |
| 39 | 36 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 decoder_->Reset(base::Bind(&MojoVideoDecoderService::OnDecoderReset, | 118 decoder_->Reset(base::Bind(&MojoVideoDecoderService::OnDecoderReset, |
| 122 weak_this_, callback)); | 119 weak_this_, callback)); |
| 123 } | 120 } |
| 124 | 121 |
| 125 void MojoVideoDecoderService::OnDecoderReset(const ResetCallback& callback) { | 122 void MojoVideoDecoderService::OnDecoderReset(const ResetCallback& callback) { |
| 126 DVLOG(1) << __FUNCTION__; | 123 DVLOG(1) << __FUNCTION__; |
| 127 callback.Run(); | 124 callback.Run(); |
| 128 } | 125 } |
| 129 | 126 |
| 130 } // namespace media | 127 } // namespace media |
| OLD | NEW |