From 0c0ab1cf5433058a682e7314227a3a2be4b8291f Mon Sep 17 00:00:00 2001 From: alexanderbobrovnik <136349302+alexanderbobrovnik@users.noreply.github.com> Date: Fri, 14 Jun 2024 01:13:15 +0300 Subject: [PATCH] [android] Switch from scoped_ptr to std::unique_ptr (#3550) b/291356560 Test-On-Device: True --- .../android/shared/application_android.h | 4 +- starboard/android/shared/audio_decoder.h | 3 +- .../shared/audio_renderer_passthrough.cc | 2 +- .../android/shared/configuration_public.h | 2 + .../android/shared/media_codec_bridge.cc | 28 +++---- starboard/android/shared/media_codec_bridge.h | 6 +- starboard/android/shared/media_decoder.h | 3 +- starboard/android/shared/microphone_impl.cc | 4 +- .../shared/player_components_factory.cc | 4 +- .../shared/player_components_factory.h | 78 ++++++++++--------- starboard/android/shared/player_create.cc | 5 +- starboard/android/shared/video_decoder.cc | 6 +- starboard/android/shared/video_decoder.h | 8 +- 13 files changed, 81 insertions(+), 72 deletions(-) diff --git a/starboard/android/shared/application_android.h b/starboard/android/shared/application_android.h index 1ceefd919350..81df8728f745 100644 --- a/starboard/android/shared/application_android.h +++ b/starboard/android/shared/application_android.h @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -28,7 +29,6 @@ #include "starboard/common/atomic.h" #include "starboard/common/condition_variable.h" #include "starboard/common/mutex.h" -#include "starboard/common/scoped_ptr.h" #include "starboard/configuration.h" #include "starboard/shared/internal_only.h" #include "starboard/shared/starboard/application.h" @@ -155,7 +155,7 @@ class ApplicationAndroid // |input_events_generator_| is accessed from multiple threads, so use a mutex // to safely access it. Mutex input_mutex_; - scoped_ptr input_events_generator_; + std::unique_ptr input_events_generator_; bool last_is_accessibility_high_contrast_text_enabled_; diff --git a/starboard/android/shared/audio_decoder.h b/starboard/android/shared/audio_decoder.h index 1ee32d63c5d1..549bdd1465eb 100644 --- a/starboard/android/shared/audio_decoder.h +++ b/starboard/android/shared/audio_decoder.h @@ -17,6 +17,7 @@ #include +#include #include #include @@ -93,7 +94,7 @@ class AudioDecoder std::queue > decoded_audios_; AudioFrameDiscarder audio_frame_discarder_; - scoped_ptr media_decoder_; + std::unique_ptr media_decoder_; }; } // namespace shared diff --git a/starboard/android/shared/audio_renderer_passthrough.cc b/starboard/android/shared/audio_renderer_passthrough.cc index ba338684ed1c..b2d86b71f251 100644 --- a/starboard/android/shared/audio_renderer_passthrough.cc +++ b/starboard/android/shared/audio_renderer_passthrough.cc @@ -82,7 +82,7 @@ AudioRendererPassthrough::AudioRendererPassthrough( audio_stream_info_.codec == kSbMediaAudioCodecEac3); if (SbDrmSystemIsValid(drm_system)) { SB_LOG(INFO) << "Creating AudioDecoder as decryptor."; - scoped_ptr audio_decoder(new AudioDecoder( + std::unique_ptr audio_decoder(new AudioDecoder( audio_stream_info, drm_system, enable_flush_during_seek)); if (audio_decoder->is_valid()) { decoder_.reset(audio_decoder.release()); diff --git a/starboard/android/shared/configuration_public.h b/starboard/android/shared/configuration_public.h index 9180733d6f6a..036a119bc499 100644 --- a/starboard/android/shared/configuration_public.h +++ b/starboard/android/shared/configuration_public.h @@ -23,6 +23,8 @@ #ifndef STARBOARD_ANDROID_SHARED_CONFIGURATION_PUBLIC_H_ #define STARBOARD_ANDROID_SHARED_CONFIGURATION_PUBLIC_H_ +#define DEPRECATED_SCOPED_PTR + // --- System Header Configuration ------------------------------------------- // Any system headers listed here that are not provided by the platform will be diff --git a/starboard/android/shared/media_codec_bridge.cc b/starboard/android/shared/media_codec_bridge.cc index cf7791672489..a4b8bc0113ca 100644 --- a/starboard/android/shared/media_codec_bridge.cc +++ b/starboard/android/shared/media_codec_bridge.cc @@ -156,7 +156,7 @@ Java_dev_cobalt_media_MediaCodecBridge_nativeOnMediaCodecOutputFormatChanged( } // static -scoped_ptr MediaCodecBridge::CreateAudioMediaCodecBridge( +std::unique_ptr MediaCodecBridge::CreateAudioMediaCodecBridge( const AudioStreamInfo& audio_stream_info, Handler* handler, jobject j_media_crypto) { @@ -165,7 +165,7 @@ scoped_ptr MediaCodecBridge::CreateAudioMediaCodecBridge( SupportedAudioCodecToMimeType(audio_stream_info.codec, &is_passthrough); if (!mime) { SB_LOG(ERROR) << "Unsupported codec " << audio_stream_info.codec << "."; - return scoped_ptr(NULL); + return std::unique_ptr(); } std::string decoder_name = @@ -175,7 +175,7 @@ scoped_ptr MediaCodecBridge::CreateAudioMediaCodecBridge( if (decoder_name.empty()) { SB_LOG(ERROR) << "Failed to find decoder for " << audio_stream_info.codec << "."; - return scoped_ptr(NULL); + return std::unique_ptr(); } if (MediaCodecBridgeEradicator::GetInstance()->IsEnabled()) { @@ -195,7 +195,7 @@ scoped_ptr MediaCodecBridge::CreateAudioMediaCodecBridge( ScopedLocalJavaRef j_mime(env->NewStringStandardUTFOrAbort(mime)); ScopedLocalJavaRef j_decoder_name( env->NewStringStandardUTFOrAbort(decoder_name.c_str())); - scoped_ptr native_media_codec_bridge( + std::unique_ptr native_media_codec_bridge( new MediaCodecBridge(handler)); jobject j_media_codec_bridge = env->CallStaticObjectMethodOrAbort( "dev/cobalt/media/MediaCodecBridgeBuilder", "createAudioDecoder", @@ -209,16 +209,16 @@ scoped_ptr MediaCodecBridge::CreateAudioMediaCodecBridge( if (!j_media_codec_bridge) { SB_LOG(ERROR) << "Failed to create codec bridge for " << audio_stream_info.codec << "."; - return scoped_ptr(NULL); + return std::unique_ptr(); } j_media_codec_bridge = env->ConvertLocalRefToGlobalRef(j_media_codec_bridge); native_media_codec_bridge->Initialize(j_media_codec_bridge); - return native_media_codec_bridge.Pass(); + return native_media_codec_bridge; } // static -scoped_ptr MediaCodecBridge::CreateVideoMediaCodecBridge( +std::unique_ptr MediaCodecBridge::CreateVideoMediaCodecBridge( SbMediaVideoCodec video_codec, int width_hint, int height_hint, @@ -243,7 +243,7 @@ scoped_ptr MediaCodecBridge::CreateVideoMediaCodecBridge( const char* mime = SupportedVideoCodecToMimeType(video_codec); if (!mime) { *error_message = FormatString("Unsupported mime for codec %d", video_codec); - return scoped_ptr(NULL); + return std::unique_ptr(); } const bool must_support_secure = require_secured_decoder; @@ -274,7 +274,7 @@ scoped_ptr MediaCodecBridge::CreateVideoMediaCodecBridge( *error_message = FormatString("Failed to find decoder: %s, mustSupportSecure: %d.", mime, !!j_media_crypto); - return scoped_ptr(NULL); + return std::unique_ptr(); } if (MediaCodecBridgeEradicator::GetInstance()->IsEnabled()) { @@ -321,7 +321,7 @@ scoped_ptr MediaCodecBridge::CreateVideoMediaCodecBridge( "dev/cobalt/media/MediaCodecBridge$CreateMediaCodecBridgeResult", "()V")); - scoped_ptr native_media_codec_bridge( + std::unique_ptr native_media_codec_bridge( new MediaCodecBridge(handler)); env->CallStaticVoidMethodOrAbort( "dev/cobalt/media/MediaCodecBridge", "createVideoMediaCodecBridge", @@ -346,12 +346,12 @@ scoped_ptr MediaCodecBridge::CreateVideoMediaCodecBridge( env->CallObjectMethodOrAbort(j_create_media_codec_bridge_result.Get(), "errorMessage", "()Ljava/lang/String;")); *error_message = env->GetStringStandardUTFOrAbort(j_error_message.Get()); - return scoped_ptr(NULL); + return std::unique_ptr(); } j_media_codec_bridge = env->ConvertLocalRefToGlobalRef(j_media_codec_bridge); native_media_codec_bridge->Initialize(j_media_codec_bridge); - return native_media_codec_bridge.Pass(); + return native_media_codec_bridge; } MediaCodecBridge::~MediaCodecBridge() { @@ -413,8 +413,8 @@ jint MediaCodecBridge::QueueSecureInputBuffer( // Reshape the sub sample mapping like this: // [(c0, e0), (c1, e1), ...] -> [c0, c1, ...] and [e0, e1, ...] int32_t subsample_count = drm_sample_info.subsample_count; - scoped_array clear_bytes(new jint[subsample_count]); - scoped_array encrypted_bytes(new jint[subsample_count]); + std::unique_ptr clear_bytes(new jint[subsample_count]); + std::unique_ptr encrypted_bytes(new jint[subsample_count]); for (int i = 0; i < subsample_count; ++i) { clear_bytes[i] = drm_sample_info.subsample_mapping[i].clear_byte_count; encrypted_bytes[i] = diff --git a/starboard/android/shared/media_codec_bridge.h b/starboard/android/shared/media_codec_bridge.h index 079d9ce99898..bf465c0734d4 100644 --- a/starboard/android/shared/media_codec_bridge.h +++ b/starboard/android/shared/media_codec_bridge.h @@ -15,13 +15,13 @@ #ifndef STARBOARD_ANDROID_SHARED_MEDIA_CODEC_BRIDGE_H_ #define STARBOARD_ANDROID_SHARED_MEDIA_CODEC_BRIDGE_H_ +#include #include #include "starboard/android/shared/jni_env_ext.h" #include "starboard/android/shared/jni_utils.h" #include "starboard/android/shared/media_common.h" #include "starboard/common/optional.h" -#include "starboard/common/scoped_ptr.h" #include "starboard/shared/starboard/media/media_util.h" namespace starboard { @@ -144,7 +144,7 @@ class MediaCodecBridge { ~Handler() {} }; - static scoped_ptr CreateAudioMediaCodecBridge( + static std::unique_ptr CreateAudioMediaCodecBridge( const AudioStreamInfo& audio_stream_info, Handler* handler, jobject j_media_crypto); @@ -155,7 +155,7 @@ class MediaCodecBridge { // resolutions the platform can decode. // Both of them have to be set at the same time (i.e. we cannot set one of // them without the other), which will be checked in the function. - static scoped_ptr CreateVideoMediaCodecBridge( + static std::unique_ptr CreateVideoMediaCodecBridge( SbMediaVideoCodec video_codec, // `width_hint` and `height_hint` are used to create the Android video // format, which don't have to be directly related to the resolution of diff --git a/starboard/android/shared/media_decoder.h b/starboard/android/shared/media_decoder.h index 8475f31857ea..7041d120bd9f 100644 --- a/starboard/android/shared/media_decoder.h +++ b/starboard/android/shared/media_decoder.h @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -206,7 +207,7 @@ class MediaDecoder // Working thread to avoid lengthy decoding work block the player thread. pthread_t decoder_thread_ = 0; - scoped_ptr media_codec_bridge_; + std::unique_ptr media_codec_bridge_; }; } // namespace shared diff --git a/starboard/android/shared/microphone_impl.cc b/starboard/android/shared/microphone_impl.cc index 68c41884935d..f52c4037a86e 100644 --- a/starboard/android/shared/microphone_impl.cc +++ b/starboard/android/shared/microphone_impl.cc @@ -19,12 +19,12 @@ #include #include +#include #include #include "starboard/android/shared/jni_env_ext.h" #include "starboard/common/log.h" #include "starboard/common/mutex.h" -#include "starboard/common/scoped_ptr.h" #include "starboard/memory.h" #include "starboard/shared/starboard/thread_checker.h" @@ -251,7 +251,7 @@ int SbMicrophoneImpl::Read(void* out_audio_data, int audio_data_size) { } int read_bytes = 0; - scoped_ptr buffer; + std::unique_ptr buffer; { ScopedLock lock(ready_queue_mutex_); // Go through the ready queue, reading and sending audio data. diff --git a/starboard/android/shared/player_components_factory.cc b/starboard/android/shared/player_components_factory.cc index 10fc27ef5ec4..47b929baee71 100644 --- a/starboard/android/shared/player_components_factory.cc +++ b/starboard/android/shared/player_components_factory.cc @@ -23,8 +23,8 @@ namespace player { namespace filter { // static -scoped_ptr PlayerComponents::Factory::Create() { - return make_scoped_ptr( +std::unique_ptr PlayerComponents::Factory::Create() { + return std::unique_ptr( new android::shared::PlayerComponentsFactory); } diff --git a/starboard/android/shared/player_components_factory.h b/starboard/android/shared/player_components_factory.h index 536b404c67ea..03e1034679de 100644 --- a/starboard/android/shared/player_components_factory.h +++ b/starboard/android/shared/player_components_factory.h @@ -15,7 +15,9 @@ #ifndef STARBOARD_ANDROID_SHARED_PLAYER_COMPONENTS_FACTORY_H_ #define STARBOARD_ANDROID_SHARED_PLAYER_COMPONENTS_FACTORY_H_ +#include #include +#include #include #include "starboard/android/shared/audio_decoder.h" @@ -31,7 +33,6 @@ #include "starboard/common/log.h" #include "starboard/common/media.h" #include "starboard/common/ref_counted.h" -#include "starboard/common/scoped_ptr.h" #include "starboard/media.h" #include "starboard/shared/opus/opus_audio_decoder.h" #include "starboard/shared/starboard/media/media_util.h" @@ -156,10 +157,10 @@ class PlayerComponentsPassthrough : public starboard::shared::starboard::player::filter::PlayerComponents { public: PlayerComponentsPassthrough( - scoped_ptr audio_renderer, - scoped_ptr video_renderer) - : audio_renderer_(audio_renderer.Pass()), - video_renderer_(video_renderer.Pass()) {} + std::unique_ptr audio_renderer, + std::unique_ptr video_renderer) + : audio_renderer_(std::move(audio_renderer)), + video_renderer_(std::move(video_renderer)) {} private: // PlayerComponents methods @@ -169,8 +170,8 @@ class PlayerComponentsPassthrough AudioRenderer* GetAudioRenderer() override { return audio_renderer_.get(); } VideoRenderer* GetVideoRenderer() override { return video_renderer_.get(); } - scoped_ptr audio_renderer_; - scoped_ptr video_renderer_; + std::unique_ptr audio_renderer_; + std::unique_ptr video_renderer_; }; // TODO: Invesigate if the implementation of member functions should be moved @@ -205,7 +206,7 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: return (value + alignment - 1) / alignment * alignment; } - scoped_ptr CreateComponents( + std::unique_ptr CreateComponents( const CreationParameters& creation_parameters, std::string* error_message) override { SB_DCHECK(error_message); @@ -221,13 +222,13 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: MimeType audio_mime_type(creation_parameters.audio_mime()); if (!audio_mime_type.is_valid() || !audio_mime_type.ValidateBoolParameter("audiopassthrough")) { - return scoped_ptr(); + return std::unique_ptr(); } if (!audio_mime_type.GetParamBoolValue("audiopassthrough", true)) { SB_LOG(INFO) << "Mime attribute \"audiopassthrough\" is set to: " "false. Passthrough is disabled."; - return scoped_ptr(); + return std::unique_ptr(); } } @@ -250,12 +251,12 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: SB_LOG(INFO) << "Creating passthrough components."; // TODO: Enable tunnel mode for passthrough - scoped_ptr audio_renderer; + std::unique_ptr audio_renderer; audio_renderer.reset(new AudioRendererPassthrough( creation_parameters.audio_stream_info(), creation_parameters.drm_system(), enable_flush_during_seek)); if (!audio_renderer->is_valid()) { - return scoped_ptr(); + return std::unique_ptr(); } // Set max_video_input_size with a positive value to overwrite @@ -265,13 +266,14 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: << "The maximum size in bytes of a buffer of data is " << max_video_input_size; - scoped_ptr<::starboard::shared::starboard::player::filter::VideoRenderer> + std::unique_ptr< + ::starboard::shared::starboard::player::filter::VideoRenderer> video_renderer; if (creation_parameters.video_codec() != kSbMediaVideoCodecNone) { constexpr int kTunnelModeAudioSessionId = -1; constexpr bool kForceSecurePipelineUnderTunnelMode = false; - scoped_ptr video_decoder = + std::unique_ptr video_decoder = CreateVideoDecoder(creation_parameters, kTunnelModeAudioSessionId, kForceSecurePipelineUnderTunnelMode, max_video_input_size, error_message); @@ -283,23 +285,23 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: auto media_time_provider = audio_renderer.get(); video_renderer.reset(new VideoRendererImpl( - scoped_ptr(video_decoder.Pass()), - media_time_provider, video_render_algorithm.Pass(), + std::unique_ptr(std::move(video_decoder)), + media_time_provider, std::move(video_render_algorithm), video_renderer_sink)); } else { - return scoped_ptr(); + return std::unique_ptr(); } } - return scoped_ptr(new PlayerComponentsPassthrough( - audio_renderer.Pass(), video_renderer.Pass())); + return std::unique_ptr(new PlayerComponentsPassthrough( + std::move(audio_renderer), std::move(video_renderer))); } bool CreateSubComponents( const CreationParameters& creation_parameters, - scoped_ptr* audio_decoder, - scoped_ptr* audio_renderer_sink, - scoped_ptr* video_decoder, - scoped_ptr* video_render_algorithm, + std::unique_ptr* audio_decoder, + std::unique_ptr* audio_renderer_sink, + std::unique_ptr* video_decoder, + std::unique_ptr* video_render_algorithm, scoped_refptr* video_renderer_sink, std::string* error_message) override { SB_DCHECK(error_message); @@ -430,23 +432,25 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: audio_stream_info.codec == kSbMediaAudioCodecOpus && !SbDrmSystemIsValid(drm_system) && !kForcePlatformOpusDecoder; if (use_libopus_decoder) { - scoped_ptr audio_decoder_impl( + std::unique_ptr audio_decoder_impl( new OpusAudioDecoder(audio_stream_info)); if (audio_decoder_impl->is_valid()) { - return audio_decoder_impl.PassAs(); + return std::unique_ptr( + std::move(audio_decoder_impl)); } } else if (audio_stream_info.codec == kSbMediaAudioCodecAac || audio_stream_info.codec == kSbMediaAudioCodecOpus) { - scoped_ptr audio_decoder_impl(new AudioDecoder( + std::unique_ptr audio_decoder_impl(new AudioDecoder( audio_stream_info, drm_system, enable_flush_during_seek)); if (audio_decoder_impl->is_valid()) { - return audio_decoder_impl.PassAs(); + return std::unique_ptr( + std::move(audio_decoder_impl)); } } else { SB_LOG(ERROR) << "Unsupported audio codec " << audio_stream_info.codec; } - return scoped_ptr(); + return std::unique_ptr(); }; audio_decoder->reset(new AdaptiveAudioDecoder( @@ -482,7 +486,7 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: force_secure_pipeline_under_tunnel_mode = false; } - scoped_ptr video_decoder_impl = + std::unique_ptr video_decoder_impl = CreateVideoDecoder(creation_parameters, tunnel_mode_audio_session_id, force_secure_pipeline_under_tunnel_mode, max_video_input_size, error_message); @@ -525,7 +529,7 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: *max_cached_frames = AlignUp(*max_cached_frames, kAudioSinkFramesAlignment); } - scoped_ptr CreateVideoDecoder( + std::unique_ptr CreateVideoDecoder( const CreationParameters& creation_parameters, int tunnel_mode_audio_session_id, bool force_secure_pipeline_under_tunnel_mode, @@ -556,7 +560,7 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: enable_flush_during_seek = true; } - scoped_ptr video_decoder(new VideoDecoder( + std::unique_ptr video_decoder(new VideoDecoder( creation_parameters.video_stream_info(), creation_parameters.drm_system(), creation_parameters.output_mode(), creation_parameters.decode_target_graphics_context_provider(), @@ -566,11 +570,11 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: max_video_input_size, enable_flush_during_seek, error_message)); if (creation_parameters.video_codec() == kSbMediaVideoCodecAv1 || video_decoder->is_decoder_created()) { - return video_decoder.Pass(); + return video_decoder; } *error_message = "Failed to create video decoder with error: " + *error_message; - return scoped_ptr(); + return std::unique_ptr(); } bool IsTunnelModeSupported(const CreationParameters& creation_parameters, @@ -658,10 +662,10 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: return tunnel_mode_audio_session_id; } - scoped_ptr TryToCreateTunnelModeAudioRendererSink( + std::unique_ptr TryToCreateTunnelModeAudioRendererSink( int tunnel_mode_audio_session_id, const CreationParameters& creation_parameters) { - scoped_ptr audio_sink( + std::unique_ptr audio_sink( new AudioRendererSinkAndroid(tunnel_mode_audio_session_id)); // We need to double check if the audio sink can actually be created. int max_cached_frames, min_frames_per_append; @@ -681,7 +685,7 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: max_cached_frames, &callback_stub); if (audio_sink->HasStarted() && !callback_stub.error_occurred()) { audio_sink->Stop(); - return audio_sink.Pass(); + return audio_sink; } SB_LOG(WARNING) << "AudioTrack does not support tunnel mode with sample rate:" @@ -690,7 +694,7 @@ class PlayerComponentsFactory : public starboard::shared::starboard::player:: << creation_parameters.audio_stream_info().number_of_channels << ", audio format:" << creation_parameters.audio_codec() << ", and audio buffer frames:" << max_cached_frames; - return scoped_ptr(); + return std::unique_ptr(); } }; diff --git a/starboard/android/shared/player_create.cc b/starboard/android/shared/player_create.cc index 912b7059bf7e..78b4ba46f252 100644 --- a/starboard/android/shared/player_create.cc +++ b/starboard/android/shared/player_create.cc @@ -13,6 +13,7 @@ // limitations under the License. #include +#include #include "starboard/player.h" @@ -206,13 +207,13 @@ SbPlayer SbPlayerCreate(SbWindow window, } } - starboard::scoped_ptr handler( + std::unique_ptr handler( new FilterBasedPlayerWorkerHandler(creation_param, provider)); handler->SetMaxVideoInputSize( starboard::android::shared::GetMaxVideoInputSizeForCurrentThread()); SbPlayer player = SbPlayerPrivate::CreateInstance( audio_codec, video_codec, sample_deallocate_func, decoder_status_func, - player_status_func, player_error_func, context, handler.Pass()); + player_status_func, player_error_func, context, std::move(handler)); if (creation_param->output_mode != kSbPlayerOutputModeDecodeToTexture) { // TODO: accomplish this through more direct means. diff --git a/starboard/android/shared/video_decoder.cc b/starboard/android/shared/video_decoder.cc index fe252a2c2bbb..efc2b8fb711f 100644 --- a/starboard/android/shared/video_decoder.cc +++ b/starboard/android/shared/video_decoder.cc @@ -429,14 +429,14 @@ scoped_refptr VideoDecoder::GetSink() { return sink_; } -scoped_ptr +std::unique_ptr VideoDecoder::GetRenderAlgorithm() { if (tunnel_mode_audio_session_id_ == -1) { - return scoped_ptr( + return std::unique_ptr( new android::shared::VideoRenderAlgorithm(this, video_frame_tracker_.get())); } - return scoped_ptr( + return std::unique_ptr( new VideoRenderAlgorithmTunneled(video_frame_tracker_.get())); } diff --git a/starboard/android/shared/video_decoder.h b/starboard/android/shared/video_decoder.h index fe77d4aa19ba..011a1595acce 100644 --- a/starboard/android/shared/video_decoder.h +++ b/starboard/android/shared/video_decoder.h @@ -76,7 +76,7 @@ class VideoDecoder ~VideoDecoder() override; scoped_refptr GetSink(); - scoped_ptr GetRenderAlgorithm(); + std::unique_ptr GetRenderAlgorithm(); void Initialize(const DecoderStatusCB& decoder_status_cb, const ErrorCB& error_cb) override; @@ -160,10 +160,10 @@ class VideoDecoder // On some platforms tunnel mode is only supported in the secure pipeline. So // we create a dummy drm system to force the video playing in secure pipeline // to enable tunnel mode. - scoped_ptr drm_system_to_enforce_tunnel_mode_; + std::unique_ptr drm_system_to_enforce_tunnel_mode_; const bool is_video_frame_tracker_enabled_; - scoped_ptr video_frame_tracker_; + std::unique_ptr video_frame_tracker_; // Preroll in tunnel mode is handled in this class instead of in the renderer. atomic_bool tunnel_mode_prerolling_{true}; @@ -191,7 +191,7 @@ class VideoDecoder // The last enqueued |SbMediaColorMetadata|. optional color_metadata_; - scoped_ptr media_decoder_; + std::unique_ptr media_decoder_; atomic_int32_t number_of_frames_being_decoded_; scoped_refptr sink_;