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

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

Issue 215783002: Fix an issue that audio and video may run out of sync (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressing acolwell's comments Created 6 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
« no previous file with comments | « media/base/android/media_decoder_job.cc ('k') | media/base/android/media_source_player.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_source_player.h
diff --git a/media/base/android/media_source_player.h b/media/base/android/media_source_player.h
index ed0483cd835ff34fd4757f2fe67fea5749a17502..bd8457ed734ebfeb5ef97dea2cd530154d4cf9e8 100644
--- a/media/base/android/media_source_player.h
+++ b/media/base/android/media_source_player.h
@@ -29,7 +29,6 @@
namespace media {
class AudioDecoderJob;
-class AudioTimestampHelper;
class VideoDecoderJob;
// This class handles media source extensions on Android. It uses Android
@@ -77,8 +76,8 @@ class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid,
friend class MediaSourcePlayerTest;
// Update the current timestamp.
- void UpdateTimestamps(base::TimeDelta presentation_timestamp,
- size_t audio_output_bytes);
+ void UpdateTimestamps(base::TimeDelta current_presentation_timestamp,
+ base::TimeDelta max_presentation_timestamp);
// Helper function for starting media playback.
void StartInternal();
@@ -89,8 +88,8 @@ class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid,
// Called when the decoder finishes its task.
void MediaDecoderCallback(
bool is_audio, MediaCodecStatus status,
- base::TimeDelta presentation_timestamp,
- size_t audio_output_bytes);
+ base::TimeDelta current_presentation_timestamp,
+ base::TimeDelta max_presentation_timestamp);
// Gets MediaCrypto object from |drm_bridge_|.
base::android::ScopedJavaLocalRef<jobject> GetMediaCrypto();
@@ -133,10 +132,14 @@ class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid,
void OnDecoderStarved();
// Starts the |decoder_starvation_callback_| task with the timeout value.
- // |presentation_timestamp| - The presentation timestamp used for starvation
- // timeout computations. It represents the timestamp of the last piece of
- // decoded data.
- void StartStarvationCallback(base::TimeDelta presentation_timestamp);
+ // |current_presentation_timestamp| - The presentation timestamp used for
+ // starvation timeout computations. It represents the current timestamp of
+ // rendered data.
+ // |max_presentation_timestamp| - The presentation timestamp if all the
+ // decoded data are rendered.
+ void StartStarvationCallback(
+ base::TimeDelta current_presentation_timestamp,
+ base::TimeDelta max_presentation_timestamp);
// Schedules a seek event in |pending_events_| and calls StopDecode() on all
// the MediaDecoderJobs. Sets clock to |seek_time|, and resets
@@ -266,9 +269,6 @@ class MEDIA_EXPORT MediaSourcePlayer : public MediaPlayerAndroid,
// elapses.
base::CancelableClosure decoder_starvation_callback_;
- // Object to calculate the current audio timestamp for A/V sync.
- scoped_ptr<AudioTimestampHelper> audio_timestamp_helper_;
-
MediaDrmBridge* drm_bridge_;
// No decryption key available to decrypt the encrypted buffer. In this case,
« no previous file with comments | « media/base/android/media_decoder_job.cc ('k') | media/base/android/media_source_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698