Hi Leonardo,
I'm using LTIB, BSP 2.6.35_1.1.0 and FSL codecs 3.06.
Yes, I know about the ref counting, and as I've read gstreamer is heavily threaded I even added a large sleep in my while(1), just to allow any thread to finish, but with no success.
1. Running twice (I've done it 5 times actually) gst-launch playbin2 uri=file:///mnt/gonzalo/Copreci-heart_x264_200x120_12000_15fps_320_22050.mp4 everything works fine (only once I've got a lot of dropped buffers). I keep my printks in mxs_pxp.c so I can see how the PXP is open and closed and the number of users. Every time the video finishes, the driver is closed. Here is the log for 2 consecutive runs:
root@freescale ~$
root@freescale ~$ gst-launch playbin2 uri=file:///mnt/gonzalo/Copreci-heart_x264_200x120_12000_15fps_320_22050.mp4
Setting pipeline to PAUSED ...
Aiur: 3.0.6
Core: MPEG4PARSER_06.04.27 build on Dec 20 2012 16:48:05
mime: video/quicktime; audio/x-m4a; application/x-3gp
file: /usr/lib/imx-mm/parser/lib_mp4_parser_arm9_elinux.so.3.1
Pipeline is PREROLLING ...
Content Info:
URI:
file:///mnt/gonzalo/Copreci-heart_x264_200x120_12000_15fps_320_22050.mp4
Idx File:
/root/.aiur/.mnt.gonzalo.Copreci-heart_x264_200x120_12000_15fps_320_22050.mp4.ai
dx
Seekable : Yes
Size(byte): 18666817
Movie Info:
Seekable : Yes
Live : No
Duration : 0:01:41.000000000
ReadMode : File
Track : 2
Track 00 [video_000000] Enabled
Duration: 0:01:41.000000000
Language: eng
Mime:
video/x-h264, parsed=(boolean)true, width=(int)200, height=(int)120, framerate=(
fraction)15/1, codec_data=(buffer)000000016742c00ddb0d11e59610000003001000000301
e0f142ae0000000168ca8cb2
H264D_ARM9_02.06.01 build on Jul 12 2011 14:01:56.
MFW_GST_H264_DECODER_PLUGIN 3.0.6 build on Feb 5 2014 15:30:55.
Track 01 [audio_000000] Enabled
Duration: 0:01:40.850000000
Language: eng
Mime:
audio/mpeg, mpegversion=(int)1, framed=(boolean)true, channels=(int)2, rate=(int
)22050, bitrate=(int)160013
[ 444.470000][pxp_open] pxp->users = 0
[ 444.480000][pxp_close] pxp->users = 1
MFW_GST_V4LSINK_PLUGIN 3.0.6 build on Feb 5 2014 15:30:44.
Beep: 3.0.6
Core: MP3 decoder Wrapper build on Jan 16 2013 16:21:07
mime: audio/mpeg, mpegversion = (int)1
file: /usr/lib/imx-mm/audio-codec/wrap/lib_mp3d_wrap_arm9_elinux.so
CODEC: BLN_MAD-MMCODECS_MP3D_ARM_02.13.00_ARM9 build on Dec 5 2012 09:
[ 445.720000] [pxp_open] pxp->users = 0
44:32.
>>V4L_SINK: Actually buffer status:
hardware buffer : 21
software buffer : 0
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
full screen size:480x272
[V4L Update Display]: left=0, top=0, width=480, height=272
New clock: GstAudioSinkClock
Got EOS from element "playbin20".
Execution ended after 100569875001 ns.
Setting pipeline to PAUSED ...
Running time 0:01:40.939682539 render fps 14.207
Setting pipeline to READY ...
Total rendered:1434
Setting pipeline to NULL ...
[--->FINALIZE aiurdemux
Freeing pipeline ...
[ 547.090000] [pxp_close] pxp->users = 1
root@freescale ~$
root@freescale ~$
root@freescale ~$
root@freescale ~$
root@freescale ~$ gst-launch playbin2 uri=file:///mnt/gonzalo/Copreci-heart_x264_200x120_12000_15fps_320_22050.mp4
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Aiur: 3.0.6
Core: MPEG4PARSER_06.04.27 build on Dec 20 2012 16:48:05
mime: video/quicktime; audio/x-m4a; application/x-3gp
file: /usr/lib/imx-mm/parser/lib_mp4_parser_arm9_elinux.so.3.1
Content Info:
URI:
file:///mnt/gonzalo/Copreci-heart_x264_200x120_12000_15fps_320_22050.mp4
Idx File:
/root/.aiur/.mnt.gonzalo.Copreci-heart_x264_200x120_12000_15fps_320_22050.mp4.ai
dx
Seekable : Yes
Size(byte): 18666817
Movie Info:
Seekable : Yes
Live : No
Duration : 0:01:41.000000000
ReadMode : File
Track : 2
Track 00 [video_000000] Enabled
Duration: 0:01:41.000000000
Language: eng
Mime:
video/x-h264, parsed=(boolean)true, width=(int)200, height=(int)120, framerate=(
fraction)15/1, codec_data=(buffer)000000016742c00ddb0d11e59610000003001000000301
e0f142ae0000000168ca8cb2
H264D_ARM9_02.06.01 build on Jul 12 2011 14:01:56.
MFW_GST_H264_DECODER_PLUGIN 3.0.6 build on Feb 5 2014 15:30:55.
Track 01 [audio_000000] Enabled
Duration: 0:01:40.850000000
Language: eng
Mime:
audio/mpeg, mpegversion=(int)1, framed=(boolean)true, channels=(int)2, rate=(int
)22050, bitrate=(int)160013
[ 562.510000][pxp_open] pxp->users = 0
[ 562.520000][pxp_close] pxp->users = 1
MFW_GST_V4LSINK_PLUGIN 3.0.6 build on Feb 5 2014 15:30:44.
Beep: 3.0.6
Core: MP3 decoder Wrapper build on Jan 16 2013 16:21:07
mime: audio/mpeg, mpegversion = (int)1
file: /usr/lib/imx-mm/audio-codec/wrap/lib_mp3d_wrap_arm9_elinux.so
CODEC: BLN_MAD-MMCODECS_MP3D_ARM_02.13.00_ARM9 build on Dec 5 2012 09:44:32.
[ 563.370000][pxp_open] pxp->users = 0
>>V4L_SINK: Actually buffer status:
hardware buffer : 21
software buffer : 0
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
full screen size:480x272
[V4L Update Display]: left=0, top=0, width=480, height=272
New clock: GstAudioSinkClock
WARNING: from element /GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstAutoVideoSink:videosink/MFW_GST_V4LSINK_INFO_T:videosink-actual-sink-mfw_v4l: A lot of buffers.
Additional debug info:
gstbasesink.c(2866): gst_base_sink_is_too_late (): /GstPlayBin2:playbin20/GstPlaySink:playsink0/GstBin:vbin/GstAutoVideoSink:videosink/MFW_GST_V4LSINK_INFO_T:videosink-actual-s:
There may be a timestamping problem, or this computer is too slow.
Got EOS from element "playbin20".
Execution ended after 100570866301 ns.
Setting pipeline to PAUSED ...
Running time 0:01:40.974835432 render fps 14.496
Setting pipeline to READY ...
Total rendered:1429
Setting pipeline to NULL ...
[--->FINALIZE aiurdemux
Freeing pipeline ...
[ 675.810000][pxp_close] pxp->users = 1
root@freescale ~$
root@freescale ~$
root@freescale ~$
root@freescale ~$
2. If I eliminate the while(1) statement, I can run my app for unlimited times and the video plays fine. The log is similar to the previous one and I can see the PXP driver being closed at the end of the video.
If inside the while(1) statement I fork and run the video_play function in the child process, the behaviour is also good - video is played again and again, and the driver is properly closed at the end of each play.
Regards,
Gonzalo.