什么是事件在Android的媒体播放器是什么意思? [英] What is meant by event in Android Media Player?

查看:191
本文介绍了什么是事件在Android的媒体播放器是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图分析信息流交换,而在Android的播放视频。我碰到这个形象来了,而这样做。

I am trying to analyze flow of messages exchanged while playing a video in Android. I came across this image while doing so.

http://img521.imageshack.us/img521/3585/capturehb.png

然后,我经历了AwesomePlayer和TimedEventQueue源文件了。我无法得到什么是由这些文件事件的意思。
对于任何帮助,这是AP preciated。结果
谢谢你。

Then I went through the source files for AwesomePlayer and TimedEventQueue. I am unable to get what is meant by event in those files. Any help regarding this is appreciated.
Thank you.

有关TimedEventQueue源文件链接如下连接。

Link for TimedEventQueue source files is attached below.

<一个href=\"https://github.com/cozybit/aosp-frameworks-base/blob/master/media/libstagefright/TimedEventQueue.cpp\" rel=\"nofollow\">https://github.com/cozybit/aosp-frameworks-base/blob/master/media/libstagefright/TimedEventQueue.cpp

推荐答案

在一般情况下, TimedEventQueue 是一个机制,通过它的事件推入队列与特定暂停。在暂停,用事件相关联的功能到底是的调用这将执行某些功能。来到的关​​系 AwesomePlayer TimedEventQueue ,请找到下面这个关系的概述。

In general, TimedEventQueue is a mechanism by which an event is pushed into a queue with a specific timeout. At the end of the timeout, a function associated with the event is invoked which will perform some functionality. Coming to the relation of AwesomePlayer and TimedEventQueue, please find an overview of this relationship as below.

在Android中, AwesomePlayer 为核心实现玩家发动机其产卵的视频音频相关跟踪路径,并在播放器的整体运作,有助于引擎。

In Android, AwesomePlayer is the core implementation of the player engine which spawns of the video and audio track related paths and helps in the overall functioning of the player engine.

除此之外, AwesomePlayer 作为 SINK 视频轨道即 OMX $ C $立方厘米之间的桥梁视频去codeR 执行情况,并显示管线即表面纹理。再进 TimedEventQueue ,操作的简要总结如下。

In addition to this, AwesomePlayer serves as a SINK for the video track i.e. a bridge between OMXCodec i.e. video decoder implementation and display pipeline i.e. SurfaceTexture. Before going into the TimedEventQueue, a brief summary of operation is as below.

播放引擎工作在一个模式和 AwesomePlayer 拉从通过电话去codeR视频帧。一旦的视频帧的可用, AV同步逻辑进入画面,这将在决定渲染框架。一旦框架已经准备好进行渲染,它被传递给通过 mVideoRenderer-&GT的表面纹理模块;渲染通话

The player engine works in a pull model and AwesomePlayer pulls the video frame from the decoder through the read call. Once a video frame is available, AV Synchronization logic comes into picture which will decide when to render the frame. Once the frame is ready to be rendered, it is passed to the SurfaceTexture module through the mVideoRenderer->render call.

来到 TimedEventQueue AwesomePlayer 使用这个概念来实现上述功能。当被称为启动,一个 postVideoEvent_l()被调用。默认情况下,在后触发此事件的机器人树实现的时间延迟。当触发此事件时,相应的函数被调用。在这种情况下, onVideoEvent 被调用,这将随后与阻塞继续进行呼叫。

Coming to TimedEventQueue, AwesomePlayer uses this concept to achieve the aforementioned functionality. When a start is called, a postVideoEvent_l() is invoked. By default, there is a time delay implemented in the android tree after which this event is triggered. When this event is triggered, a corresponding function is invoked. In this case, onVideoEvent is invoked which will then proceed with the blocking read call.

视频缓冲器被接收后,如果的视频帧的比的音轨时间戳的10毫秒前面,然后又 postVideoEvent_l(10000 )被触发,这将迫使这个线程10毫秒更多的睡眠,之后 onVideoEvent 再次触发。

After a video buffer is received, if the video frame is earlier than the audio track timestamp by 10 ms, then another postVideoEvent_l(10000) is triggered which will force this thread to sleep for 10 ms more, after which onVideoEvent is again triggered.

同样,后的视频帧渲染,那么 AwesomePlayer 将触发另一个 postVideoEvent_l ()将睡眠默认的一段时间回来,并在块读再打电话。

Similarly, after a video frame is rendered, then AwesomePlayer will trigger another postVideoEvent_l() which will sleep for default period of time and come back and block in read call again.

这篇关于什么是事件在Android的媒体播放器是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆