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

Side by Side Diff: media/base/android/video_decoder_job.cc

Issue 1551103002: Convert Pass()→std::move() in //media (Android Cast edition) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
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/base/android/video_decoder_job.h" 5 #include "media/base/android/video_decoder_job.h"
6 6
7 #include <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
9 #include "base/threading/thread.h" 11 #include "base/threading/thread.h"
10 #include "media/base/android/media_drm_bridge.h" 12 #include "media/base/android/media_drm_bridge.h"
11 #include "media/base/android/sdk_media_codec_bridge.h" 13 #include "media/base/android/sdk_media_codec_bridge.h"
12 14
13 namespace media { 15 namespace media {
14 16
15 class VideoDecoderThread : public base::Thread { 17 class VideoDecoderThread : public base::Thread {
16 public: 18 public:
(...skipping 25 matching lines...) Expand all
42 44
43 bool VideoDecoderJob::SetVideoSurface(gfx::ScopedJavaSurface surface) { 45 bool VideoDecoderJob::SetVideoSurface(gfx::ScopedJavaSurface surface) {
44 // For an empty surface, always pass it to the |media_codec_bridge_| job so 46 // For an empty surface, always pass it to the |media_codec_bridge_| job so
45 // that it can detach from the current one. Otherwise, don't pass an 47 // that it can detach from the current one. Otherwise, don't pass an
46 // unprotected surface if the video content requires a protected one. 48 // unprotected surface if the video content requires a protected one.
47 if (!surface.IsEmpty() && IsProtectedSurfaceRequired() && 49 if (!surface.IsEmpty() && IsProtectedSurfaceRequired() &&
48 !surface.is_protected()) { 50 !surface.is_protected()) {
49 return false; 51 return false;
50 } 52 }
51 53
52 surface_ = surface.Pass(); 54 surface_ = std::move(surface);
53 need_to_reconfig_decoder_job_ = true; 55 need_to_reconfig_decoder_job_ = true;
54 return true; 56 return true;
55 } 57 }
56 58
57 bool VideoDecoderJob::HasStream() const { 59 bool VideoDecoderJob::HasStream() const {
58 return video_codec_ != kUnknownVideoCodec; 60 return video_codec_ != kUnknownVideoCodec;
59 } 61 }
60 62
61 void VideoDecoderJob::ReleaseDecoderResources() { 63 void VideoDecoderJob::ReleaseDecoderResources() {
62 MediaDecoderJob::ReleaseDecoderResources(); 64 MediaDecoderJob::ReleaseDecoderResources();
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 return (output_width_ != prev_output_width) || 159 return (output_width_ != prev_output_width) ||
158 (output_height_ != prev_output_height); 160 (output_height_ != prev_output_height);
159 } 161 }
160 162
161 bool VideoDecoderJob::IsProtectedSurfaceRequired() { 163 bool VideoDecoderJob::IsProtectedSurfaceRequired() {
162 return is_content_encrypted() && drm_bridge() && 164 return is_content_encrypted() && drm_bridge() &&
163 drm_bridge()->IsProtectedSurfaceRequired(); 165 drm_bridge()->IsProtectedSurfaceRequired();
164 } 166 }
165 167
166 } // namespace media 168 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/sdk_media_codec_bridge.cc ('k') | media/capture/video/android/video_capture_device_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698