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

Side by Side Diff: media/base/android/media_player_listener.h

Issue 11348199: Free (and pause) audio resources when getting a phone call (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_color
Patch Set: Created 8 years 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
« no previous file with comments | « media/base/android/media_player_bridge.cc ('k') | media/base/android/media_player_listener.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_LISTENER_H_ 5 #ifndef MEDIA_BASE_ANDROID_MEDIA_PLAYER_LISTENER_H_
6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_LISTENER_H_ 6 #define MEDIA_BASE_ANDROID_MEDIA_PLAYER_LISTENER_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 22 matching lines...) Expand all
33 33
34 // Called by the Java MediaPlayerListener and mirrored to corresponding 34 // Called by the Java MediaPlayerListener and mirrored to corresponding
35 // callbacks. 35 // callbacks.
36 void OnMediaError(JNIEnv* /* env */, jobject /* obj */, jint error_type); 36 void OnMediaError(JNIEnv* /* env */, jobject /* obj */, jint error_type);
37 void OnVideoSizeChanged(JNIEnv* /* env */, jobject /* obj */, 37 void OnVideoSizeChanged(JNIEnv* /* env */, jobject /* obj */,
38 jint width, jint height); 38 jint width, jint height);
39 void OnBufferingUpdate(JNIEnv* /* env */, jobject /* obj */, jint percent); 39 void OnBufferingUpdate(JNIEnv* /* env */, jobject /* obj */, jint percent);
40 void OnPlaybackComplete(JNIEnv* /* env */, jobject /* obj */); 40 void OnPlaybackComplete(JNIEnv* /* env */, jobject /* obj */);
41 void OnSeekComplete(JNIEnv* /* env */, jobject /* obj */); 41 void OnSeekComplete(JNIEnv* /* env */, jobject /* obj */);
42 void OnMediaPrepared(JNIEnv* /* env */, jobject /* obj */); 42 void OnMediaPrepared(JNIEnv* /* env */, jobject /* obj */);
43 void OnMediaInterrupted(JNIEnv* /* env */, jobject /* obj */);
43 44
44 // Create a Java MediaPlayerListener object. 45 // Create a Java MediaPlayerListener object.
45 void CreateMediaPlayerListener(jobject context, jobject media_player); 46 void CreateMediaPlayerListener(jobject context, jobject media_player);
47 void ReleaseMediaPlayerListenerResources();
46 48
47 // Register MediaPlayerListener in the system library loader. 49 // Register MediaPlayerListener in the system library loader.
48 static bool RegisterMediaPlayerListener(JNIEnv* env); 50 static bool RegisterMediaPlayerListener(JNIEnv* env);
49 51
50 private: 52 private:
51 // The message loop where |media_player_| lives. 53 // The message loop where |media_player_| lives.
52 scoped_refptr<base::MessageLoopProxy> message_loop_; 54 scoped_refptr<base::MessageLoopProxy> message_loop_;
53 55
54 // The MediaPlayerBridge object all the callbacks should be send to. 56 // The MediaPlayerBridge object all the callbacks should be send to.
55 base::WeakPtr<MediaPlayerBridge> media_player_; 57 base::WeakPtr<MediaPlayerBridge> media_player_;
56 58
59 base::android::ScopedJavaGlobalRef<jobject> j_media_player_listener_;
60
57 DISALLOW_COPY_AND_ASSIGN(MediaPlayerListener); 61 DISALLOW_COPY_AND_ASSIGN(MediaPlayerListener);
58 }; 62 };
59 63
60 } // namespace media 64 } // namespace media
61 65
62 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_LISTENER_H_ 66 #endif // MEDIA_BASE_ANDROID_MEDIA_PLAYER_LISTENER_H_
OLDNEW
« no previous file with comments | « media/base/android/media_player_bridge.cc ('k') | media/base/android/media_player_listener.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698