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

Unified Diff: media/base/android/media_source_player_with_dedicated_thread.h

Issue 1076013002: Added stub MediaSourcePlayer for developing behind the flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed old and new players, addressed some Xiaohan comments Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: media/base/android/media_source_player_with_dedicated_thread.h
diff --git a/media/base/android/media_source_player_with_dedicated_thread.h b/media/base/android/media_source_player_with_dedicated_thread.h
new file mode 100644
index 0000000000000000000000000000000000000000..5099ca3956ed5cac900bb44c9854e920ae294f0d
--- /dev/null
+++ b/media/base/android/media_source_player_with_dedicated_thread.h
@@ -0,0 +1,67 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_WITH_DEDICATED_THREAD_H_
+#define MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_WITH_DEDICATED_THREAD_H_
+
+#include "base/android/scoped_java_ref.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/thread.h"
+#include "media/base/android/demuxer_android.h"
+#include "media/base/android/media_player_android.h"
+#include "media/base/media_export.h"
+
+namespace media {
+
+class MediaSourcePlayerImpl;
+
+// Returns the task runner for the media thread
+scoped_refptr<base::SingleThreadTaskRunner> GetMediaTaskRunner();
+
+// This class handles media source extensions on Android.
+class MEDIA_EXPORT MediaSourcePlayerWithDedicatedThread :
+ public MediaPlayerAndroid {
+ public:
+ // Constructs a player with the given ID and demuxer. |manager| must outlive
+ // the lifetime of this object.
+ MediaSourcePlayerWithDedicatedThread(
+ int player_id,
+ MediaPlayerManager* manager,
+ const RequestMediaResourcesCB& request_media_resources_cb,
+ scoped_ptr<DemuxerAndroid> demuxer,
+ const GURL& frame_url);
+ ~MediaSourcePlayerWithDedicatedThread() override;
+
+ // MediaPlayerAndroid implementation.
+ void SetVideoSurface(gfx::ScopedJavaSurface surface) override;
+ void Start() override;
+ void Pause(bool is_media_related_action) override;
+ void SeekTo(base::TimeDelta timestamp) override;
+ void Release() override;
+ void SetVolume(double volume) override;
+ int GetVideoWidth() override;
+ int GetVideoHeight() override;
+ base::TimeDelta GetCurrentTime() override;
+ base::TimeDelta GetDuration() override;
+ bool IsPlaying() override;
+ bool CanPause() override;
+ bool CanSeekForward() override;
+ bool CanSeekBackward() override;
+ bool IsPlayerReady() override;
+ void SetCdm(BrowserCdm* cdm) override;
+
+
+ private:
+ MediaSourcePlayerImpl* impl_;
+
+ // NOTE: Weak pointers must be invalidated before all other member variables.
+ base::WeakPtrFactory<MediaSourcePlayerWithDedicatedThread> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaSourcePlayerWithDedicatedThread);
+};
+
+} // namespace media
+
+#endif // MEDIA_BASE_ANDROID_MEDIA_SOURCE_PLAYER_WITH_DEDICATED_THREAD_H_

Powered by Google App Engine
This is Rietveld 408576698