Android media server Parsing 1-media player service structure, android1-media
The following is one of the four services registered by media server: structure diagram of MediaPlayerService
1. In the figure, the proxy object BpMed
decoding and selection components, and supports synchronization between mainstream audio and video decoder and multi-channel media streams.4. User InterfaceMainly provides interaction interfaces between users and playersFFmpeg: it provides a complete solution for recording, conversion, and streaming audio and video.
This article from: http://freewxy.iteye.com/blog/738790
Design of Streaming Media
This article is mainly about the architecture of the most important and complex media Player (MediaPlayer) in Android. For Android, a complete and relatively complex system, the implementation of a MediaPlayer function is not a function of its specific features, but a specific feature how to adapt to the
( illegalstateexception e) {//TODO auto-generated catch Blocke.printstacktrace ();}} Onpreparedlistener Preparedlistener = new Onpreparedlistener () {@Overridepublic void onprepared (MediaPlayer MP) { Mediaplayer.start ();}};A look to understand, just at the beginning I finished prepare went directly to start, but this time may prepare has not succeeded, so reported the above error.Then you encounter a prepareasync called in State 8This workaround adds a line of code to the previous one, ensuri
encoding.Number of referencesEncoding subtitle encoding. Assume that null will self-detect itself.public int getsublocation ()Gets the caption position type. 0 for inline subtitles, 1 for external subtitles.public void Setsubpath (String subpath)Sets the external caption path. Must be a local file path.Public String Getsubpath ()Gets the external caption path.public void Setsubtrack (int trackid)Sets the caption number. Must be a return value of Getsubtrackmap.public int Getsubtrack ()Gets the
Android error MediaPlayer usage Media Player called in state *
When using Media Player, let's take a look at several issues.
The usage will not be mentioned. It is best to refer to this figure of mediaPlayer when using it.
The first error is
Android error-MediaPlayer usage: Media Player called in state *, androidmediaplayer
When using Media Player, let's take a look at several issues.
The usage will not be mentioned. It is best to refer to this figure of mediaPlayer when using it.
The first error is
With media Player, there are a few questions, rememberUsage is not said, when using the best reference to the MediaPlayer of this pictureThe first error is media Player called in State 8This is because there was no prepare before calling start, because I used theMediaPlayer = mediaplayer.create (context, r.raw.notice);
engine invokes the Oncompletion.oncompletion () callback method provided by the client programmer. Can be set by calling the Mediaplayer.setoncompletionlistener (Oncompletionlistener) method. The internal playback engine once called the Oncompletion.oncompletion () callback method, indicating that the MediaPlayer object entered the playbackcompleted state. 9.3) when in playbackcompleted state, you can call the start () method again to let the MediaPlayer object enter the started state again.
We want to develop our own media player on Android. The first thing we want to think of is to use FFMPEG for implementation. FFmpeg is a cross-platform failover function. We can call the APIS provided by FFMPEG to complete the process. In addition, FFMPEG provides a small program ffplay, which itself is a media
Reprint Please specify source: http://blog.csdn.net/zhaokaiqiang1992Today, an open blog, found a friend sent me a private message, ask the following questions, so close this article, for its doubts.From this friend's question, we need to understand the following questions, in order to give him a good answer:(1) How can I get information about all the songs in my phone?(2) When the song file changes, such as adding and deleting operations, how to updat
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.