Decoding

VLC for Android and Chrome OS specific usage questions
gmv
Blank Cone
Blank Cone
Posts: 15
Joined: 18 Feb 2013 18:46

Decoding

Postby gmv » 18 Feb 2013 19:29

Hello,
i'm analyzing the decoding of videos and i don't know how vlc does it, what functions use, in what class is implemented the decoding and where vlc saves the frames.

I believe that vlc decodes a frame and displays it until that the next frame is completly decoded.
In the VideoPlayerActivity, the following lines of code control the playback of the video, but for this his frames have had to be decoded before.
/* Start / resume playback */
if (savedIndexPosition > -1) {
mLibVLC.playIndex(savedIndexPosition);
} else if (mLocation != null && mLocation.length() > 0 && !dontParse) {
savedIndexPosition = mLibVLC.readMedia(mLocation, false);
}

In the readMedia method, creates an new media, gets the media list, locks the items of the list, gets and returns the position of an item and invokes to create_player_and_play(env, thiz, instance, position);.
In this last method (create_player_and_play), vlc creates a new media_player and a new media_list_player, sets the format of audio decoded, connects the event manager, sets he media list associated to the player and finally invokes to libvlc_media_list_player_play_item_at_index function to play video.

I need help to locate the functions that decode the video.
Thanks!

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Decoding

Postby edwardw » 23 Feb 2013 00:58

The decoding uses VLC core, which is the same logic that powers VLC for Desktop.

gmv
Blank Cone
Blank Cone
Posts: 15
Joined: 18 Feb 2013 18:46

Re: Decoding

Postby gmv » 25 Feb 2013 15:06

Sorry, but i haven't understood his reply.

I want to locate the method which performs the decoding of the frames of a video and the buffer where saves them.

i am analyzing the libvlcjni.c class since in the VideoPLayerActivity.java class invokes the native method called readMedia whose declaration is in libvlcjni.c, but i haven't found the buffer.

In libvlcjni.c is included the header file vlc.h which turn includes the libvlc_media_player.h. In this last file are defined the related functions with the decoding of the video frames, for example:
- typedef void *(*libvlc_video_lock_cb)(void *opaque, void **planes);
- typedef void (*libvlc_video_unlock_cb)(void *opaque, void *picture, void *const *planes);
- typedef void (*libvlc_video_display_cb)(void *opaque, void *picture);
- typedef unsigned (*libvlc_video_format_cb)(void **opaque, char *chroma, unsigned *width, unsigned *height, unsigned *pitches, unsigned *lines);
- typedef void (*libvlc_video_cleanup_cb)(void *opaque);

But, i haven't found where are used these functions.

Thanks!

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Decoding

Postby edwardw » 25 Feb 2013 21:35

Those functions are used by libvlc. For information on libvlc please see http://www.videolan.org/developers/vlc/ ... ibvlc.html


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 10 guests