Gstreamer play some video Segmentation fault.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Gstreamer play some video Segmentation fault.

1,107 Views
noah
Contributor I

Hi:

I use gstreamer sdk to play some video,and fould that it sometime while Segmentation fault.I use gdb to debug it,the threads and stack like this:

root@freescale ~$ gdb gst_opengles

GNU gdb 6.6

Copyright (C) 2006 Free Software Foundation, Inc.

GDB is free software, covered by the GNU General Public License, and you are

welcome to change it and/or distribute copies of it under certain conditions.

Type "show copying" to see the conditions.

There is absolutely no warranty for GDB.  Type "show warranty" for details.

This GDB was configured as "arm-none-linux-gnueabi"...

Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) set args /root/media/geesgdrgerg.mp4

(gdb) r

Starting program: /root/gst_opengles /root/media/geesgdrgerg.mp4

[Thread debugging using libthread_db enabled]

[New process 5550]

[New Thread 736661504 (LWP 5550)]

[New Thread 886994016 (LWP 5553)]

about to create gl context

device WxH:1920x1080

[New Thread 906876000 (LWP 5554)]

[TestglTexDirectVIVMap.cpp:PlayerInit:673]

Aiur: 3.0.7

Core: MPEG4PARSER_06.06.03  build on Jun 18 2013 14:52:11

  mime: video/quicktime; audio/x-m4a; application/x-3gp

  file: /usr/lib/imx-mm/parser/lib_mp4_parser_arm11_elinux.so.3.1

Content Info:

       URI:

             file:///root/media/geesgdrgerg.mp4

       Idx File:

             /root/.aiur/.root.media.geesgdrgerg.mp4.aidx

       Seekable  : Yes

       Size(byte): 100419769

Movie Info:

       Seekable  : Yes

       Live      : No

       Duration  : 0:04:03.476928000

       ReadMode  : File

       Track     : 2

Track 00 [audio_000000] Enabled

       Duration: 0:04:03.498272000

       Language: und

       Mime:

             audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)48000, bitrate=(int)1

             28000, framed=(boolean)true, stream-format=(string)raw, codec_data=(buffer)11905

             6e580

[New Thread 917501024 (LWP 5555)]

Track 01 [video_000000] Enabled

       Duration: 0:04:03.509424000

       Language: und

       Mime:

             video/x-h264, parsed=(boolean)true, width=(int)320, height=(int)128, framerate=(

             fraction)30/1, codec_data=(buffer)00000001674d401e96540a08d80b5050505400000fa400

             03a9839080009471000124f89a9503b42c5d400000000168ce3520

[New Thread 925889632 (LWP 5556)]

[INFO]  Product Info: i.MX6Q/D/S

vpudec versions :smileyhappy:

       plugin: 3.0.7

       wrapper: 1.0.35(VPUWRAPPER_ARM_LINUX Build on Oct 17 2013 17:04:53)

       vpulib: 5.4.16

       firmware: 2.3.10.40778

[New Thread 941007968 (LWP 5557)]

[New Thread 949851232 (LWP 5558)]

[INFO]  bitstreamMode 1, chromaInterleave 1, mapType 0, tiled2LinearEnable 0

Beep: 3.0.7

Core: AAC decoder Wrapper  build on Mar 15 2013 09:56:21

  mime: audio/mpeg, mpegversion=(int){2,4}

  file: /usr/lib/imx-mm/audio-codec/wrap/lib_aacd_wrap_arm12_elinux.so

CODEC: BLN_MAD-MMCODECS_AACD_ARM_03.07.00  build on Jul 17 2012 17:47:46.

[New Thread 961541216 (LWP 5559)]

[New Thread 971826272 (LWP 5560)]

GST_VIDEO_FORMAT_NV12 = [22], user_data->format = [22]

format value: NV12.

w = [320], h = [128], format = [22], buf_size =[61440]

glGenTextures: 0x00000502

glBindTexture: 0x00000000

glTexDirectVIV: 0x00000000

Program received signal SIGSEGV, Segmentation fault.

[Switching to Thread 949851232 (LWP 5558)]

0x2bd40148 in _int_free () from /lib/libc.so.6

(gdb) bt

#0  0x2bd40148 in _int_free () from /lib/libc.so.6

#1  0x2bd43dc0 in free () from /lib/libc.so.6

#2  0x2ac395c0 in IA__g_free (mem=0x38c7be30) at gmem.c:338

#3  0x2ab33584 in gst_buffer_finalize (buffer=0x362fd110) at gstbuffer.c:311

#4  0x2ab5c594 in gst_mini_object_unref (mini_object=0x362fd110) at gstminiobject.c:604

#5  0x2be51dd8 in gst_base_sink_render_object (basesink=0xd2908, obj_type=<value optimized out>, obj=0x389d8940) at gstbasesink.c:3576

#6  0x2be52e58 in gst_base_sink_queue_object_unlocked (basesink=0xd2908, obj_type=<value optimized out>, obj=0x362fd110, prerollable=<value optimized out>)

    at gstbasesink.c:3576

#7  0x2be532c0 in gst_base_sink_chain_unlocked (basesink=0xd2908, obj_type=<value optimized out>, obj=0x362fd110) at gstbasesink.c:3576

#8  0x2be5375c in gst_base_sink_chain_main (basesink=0xd2908, pad=0x10e0c8, obj_type=<value optimized out>, obj=0x362fd110) at gstbasesink.c:3576

#9  0x2ab69690 in gst_pad_push (pad=0x10a1d0, buffer=0x362fd110) at gstpad.c:249

#10 0x2ab69690 in gst_pad_push (pad=0x10e708, buffer=0x362fd110) at gstpad.c:249

#11 0x2be63568 in gst_base_transform_chain (pad=<value optimized out>, buffer=<value optimized out>) at gstbasetransform.c:1683

#12 0x2ab69690 in gst_pad_push (pad=0x10e578, buffer=0x362fd110) at gstpad.c:249

#13 0x2be63568 in gst_base_transform_chain (pad=<value optimized out>, buffer=<value optimized out>) at gstbasetransform.c:1683

#14 0x2ab69690 in gst_pad_push (pad=0x10e3e8, buffer=0x362fd110) at gstpad.c:249

#15 0x2be63568 in gst_base_transform_chain (pad=<value optimized out>, buffer=<value optimized out>) at gstbasetransform.c:1683

#16 0x2ab69690 in gst_pad_push (pad=0x10e258, buffer=0x362fd110) at gstpad.c:249

#17 0x35745420 in gst_queue_loop (pad=<value optimized out>) at gstqueue.c:443

#18 0x2ab95750 in gst_task_func (task=0x122f50) at gsttask.c:207

#19 0x2ab96c50 in default_func (tdata=<value optimized out>, pool=<value optimized out>) at gsttaskpool.c:70

#20 0x2ac5b85c in g_thread_pool_thread_proxy (data=<value optimized out>) at gthreadpool.c:726

#21 0x2ac5957c in g_thread_create_proxy (data=0x149730) at gthread.c:180

#22 0x2ad80b10 in start_thread () from /lib/libpthread.so.0

#23 0x2bd98958 in clone () from /lib/libc.so.6

(gdb) info threads

  10 Thread 971826272 (LWP 5560)  0x2ad8565c in pthread_cond_timedwait@@GLIBC_2.4 () from /lib/libpthread.so.0

  9 Thread 961541216 (LWP 5559)  0x2bd8f794 in poll () from /lib/libc.so.6

* 8 Thread 949851232 (LWP 5558)  0x2bd40148 in _int_free () from /lib/libc.so.6

  7 Thread 941007968 (LWP 5557)  0x2bd8f98c in ppoll () from /lib/libc.so.6

  6 Thread 925889632 (LWP 5556)  0x2ad85314 in pthread_cond_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

  5 Thread 917501024 (LWP 5555)  0x2ad85314 in pthread_cond_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

  4 Thread 906876000 (LWP 5554)  0x2ad85314 in pthread_cond_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

  3 Thread 886994016 (LWP 5553)  0x2bd917b8 in ioctl () from /lib/libc.so.6

  2 Thread 736661504 (LWP 5550)  0x2ad87584 in sem_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

  1 LWP 5550  0x2ad87584 in sem_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

(gdb) thread 1

[Switching to thread 1 (LWP 5550)]#0  0x2ad87584 in sem_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

(gdb) bt

#0  0x2ad87584 in sem_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

#1  0x0000acc8 in Draw (esContext=0x7e983c20) at TestglTexDirectVIVMap.cpp:200

#2  0x00009f98 in main (argc=<value optimized out>, argv=<value optimized out>) at TestglTexDirectVIVMap.cpp:416

(gdb) thread 2

[Switching to thread 2 (Thread 736661504 (LWP 5550))]#0  0x2ad87584 in sem_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

(gdb) bt

#0  0x2ad87584 in sem_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

#1  0x0000acc8 in Draw (esContext=0x7e983c20) at TestglTexDirectVIVMap.cpp:200

#2  0x00009f98 in main (argc=<value optimized out>, argv=<value optimized out>) at TestglTexDirectVIVMap.cpp:416

(gdb) thread 3

[Switching to thread 3 (Thread 886994016 (LWP 5553))]#0  0x2bd917b8 in ioctl () from /lib/libc.so.6

(gdb) bt

#0  0x2bd917b8 in ioctl () from /lib/libc.so.6

#1  0x2ae43268 in gcoOS_DeviceControl () from /usr/lib/libGAL.so

#2  0x2ae44240 in gcoOS_WaitSignal () from /usr/lib/libGAL.so

#3  0x2aaf6fcc in veglSwapWorker () from /usr/lib/libEGL.so.1

#4  0x2ad80b10 in start_thread () from /lib/libpthread.so.0

#5  0x2bd98958 in clone () from /lib/libc.so.6

(gdb) thread 4

[Switching to thread 4 (Thread 906876000 (LWP 5554))]#0  0x2ad85314 in pthread_cond_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

(gdb) bt

#0  0x2ad85314 in pthread_cond_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

#1  0x2be6ffa0 in gst_data_queue_push (queue=0x3624f760, item=0x15bf60) at gstdataqueue.c:245

#2  0x3573f130 in gst_multi_queue_chain (pad=<value optimized out>, buffer=0xf7ed0) at gstmultiqueue.c:671

#3  0x2ab69690 in gst_pad_push (pad=0x36250260, buffer=0xf7ed0) at gstpad.c:249

^[[A#4  0x358c8678 in aiurdemux_push_pad_buffer (demux=0x11a0e8, stream=0x91af8, buffer=0xf7ed0) at aiurdemux.c:795

#5  0x358c99f8 in aiurdemux_loop_state_movie (demux=0x11a0e8) at aiurdemux.c:795

#6  0x358d0d9c in aiurdemux_pull_task (pad=0xc7320) at aiurdemux.c:795

#7  0x2ab95750 in gst_task_func (task=0x11e050) at gsttask.c:207

#8  0x2ab96c50 in default_func (tdata=<value optimized out>, pool=<value optimized out>) at gsttaskpool.c:70

#9  0x2ac5b85c in g_thread_pool_thread_proxy (data=<value optimized out>) at gthreadpool.c:726

#10 0x2ac5957c in g_thread_create_proxy (data=0xf75f8) at gthread.c:180

#11 0x2ad80b10 in start_thread () from /lib/libpthread.so.0

#12 0x2bd98958 in clone () from /lib/libc.so.6

(gdb) thread 5

[Switching to thread 5 (Thread 917501024 (LWP 5555))]#0  0x2ad85314 in pthread_cond_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

(gdb) bt

#0  0x2ad85314 in pthread_cond_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

#1  0x3574441c in gst_queue_chain (pad=<value optimized out>, buffer=0x164810) at gstqueue.c:443

#2  0x2ab69690 in gst_pad_push (pad=0x10a380, buffer=0x164810) at gstpad.c:249

#3  0x2ab69690 in gst_pad_push (pad=0x1558d8, buffer=0x164810) at gstpad.c:249

#4  0x345b1608 in gst_stream_synchronizer_sink_chain (pad=<value optimized out>, buffer=<value optimized out>) at gststreamsynchronizer.c:942

#5  0x2ab69690 in gst_pad_push (pad=0x1559a0, buffer=0x164810) at gstpad.c:249

#6  0x3575174c in gst_tee_chain (pad=<value optimized out>, buffer=0x164810) at gsttee.c:863

#7  0x2ab69690 in gst_pad_push (pad=0x1215e8, buffer=0x164810) at gstpad.c:249

#8  0x2ab69690 in gst_pad_push (pad=0x129be8, buffer=0x164810) at gstpad.c:249

#9  0x35739b40 in gst_selector_pad_chain (pad=0x10f148, buf=0x164810) at gstinputselector.c:1019

#10 0x2ab69690 in gst_pad_push (pad=0x109828, buffer=0x164810) at gstpad.c:249

#11 0x2ab69690 in gst_pad_push (pad=0xe5ee8, buffer=0x164810) at gstpad.c:249

#12 0x2ab69690 in gst_pad_push (pad=0x36250198, buffer=0x164810) at gstpad.c:249

#13 0x2aab4390 in gst_beepdec_chain (pad=<value optimized out>, buffer=0x164868) at beepdec.c:810

#14 0x2ab69690 in gst_pad_push (pad=0x36250008, buffer=0x164868) at gstpad.c:249

#15 0x3573fcf8 in gst_multi_queue_loop (pad=<value optimized out>) at gstmultiqueue.c:671

#16 0x2ab95750 in gst_task_func (task=0x11e6b0) at gsttask.c:207

#17 0x2ab96c50 in default_func (tdata=<value optimized out>, pool=<value optimized out>) at gsttaskpool.c:70

#18 0x2ac5b85c in g_thread_pool_thread_proxy (data=<value optimized out>) at gthreadpool.c:726

#19 0x2ac5957c in g_thread_create_proxy (data=0x11eb38) at gthread.c:180

#20 0x2ad80b10 in start_thread () from /lib/libpthread.so.0

#21 0x2bd98958 in clone () from /lib/libc.so.6

(gdb) thread 6

[Switching to thread 6 (Thread 925889632 (LWP 5556))]#0  0x2ad85314 in pthread_cond_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

(gdb) bt

#0  0x2ad85314 in pthread_cond_wait@@GLIBC_2.4 () from /lib/libpthread.so.0

#1  0x3574441c in gst_queue_chain (pad=<value optimized out>, buffer=0x16ed20) at gstqueue.c:443

#2  0x2ab69690 in gst_pad_push (pad=0x10a0f8, buffer=0x16ed20) at gstpad.c:249

#3  0x2ab69690 in gst_pad_push (pad=0x10e000, buffer=0x16ed20) at gstpad.c:249

#4  0x345b1608 in gst_stream_synchronizer_sink_chain (pad=<value optimized out>, buffer=<value optimized out>) at gststreamsynchronizer.c:942

#5  0x2ab69690 in gst_pad_push (pad=0x1216c0, buffer=0x16ed20) at gstpad.c:249

#6  0x2ab69690 in gst_pad_push (pad=0x129b20, buffer=0x16ed20) at gstpad.c:249

#7  0x35739b40 in gst_selector_pad_chain (pad=0x10f008, buf=0x16ed20) at gstinputselector.c:1019

#8  0x2ab69690 in gst_pad_push (pad=0xd3eb8, buffer=0x16ed20) at gstpad.c:249

#9  0x2ab69690 in gst_pad_push (pad=0x120918, buffer=0x16ed20) at gstpad.c:249

#10 0x2ab69690 in gst_pad_push (pad=0x36250580, buffer=0x16ed20) at gstpad.c:249

#11 0x3616fe2c in gst_vpudec_show_frame (vpudec=0xf8230, p=<value optimized out>) at vpudec.c:1169

#12 0x36172300 in gst_vpudec_chain (pad=<value optimized out>, buffer=0x1601d0) at vpudec.c:1169

#13 0x2ab69690 in gst_pad_push (pad=0x362503f0, buffer=0x1601d0) at gstpad.c:249

#14 0x3573fcf8 in gst_multi_queue_loop (pad=<value optimized out>) at gstmultiqueue.c:671

#15 0x2ab95750 in gst_task_func (task=0x11e738) at gsttask.c:207

#16 0x2ab96c50 in default_func (tdata=<value optimized out>, pool=<value optimized out>) at gsttaskpool.c:70

#17 0x2ac5b85c in g_thread_pool_thread_proxy (data=<value optimized out>) at gthreadpool.c:726

#18 0x2ac5957c in g_thread_create_proxy (data=0x126c48) at gthread.c:180

#19 0x2ad80b10 in start_thread () from /lib/libpthread.so.0

#20 0x2bd98958 in clone () from /lib/libc.so.6

(gdb) thread 7

[Switching to thread 7 (Thread 941007968 (LWP 5557))]#0  0x2bd8f98c in ppoll () from /lib/libc.so.6

(gdb) bt

#0  0x2bd8f98c in ppoll () from /lib/libc.so.6

#1  0x2ab780c0 in gst_poll_wait (set=Unhandled dwarf expression opcode 0x9f

) at gstpoll.c:235

#2  0x2ab8d6d4 in gst_system_clock_id_wait_jitter_unlocked (clock=0x12d0d8, entry=0x10bd00, jitter=<value optimized out>, restart=0) at gstsystemclock.c:329

#3  0x2ab3e79c in gst_clock_id_wait (id=0x10bd00, jitter=0x38169980) at gstclock.c:743

#4  0x2be4da94 in gst_base_sink_wait_clock (sink=0xc8360, time=400366000, jitter=0x38169980) at gstbasesink.c:3576

#5  0x2be4fba0 in gst_base_sink_do_sync (basesink=0x0, obj=0x2be74844, late=0x38169af0, step_end=0x17dd19b0, obj_type=2 '\002') at gstbasesink.c:3576

#6  0x2be51364 in gst_base_sink_render_object (basesink=0xc8360, obj_type=<value optimized out>, obj=0x38169af0) at gstbasesink.c:3576

#7  0x2be52e58 in gst_base_sink_queue_object_unlocked (basesink=0xc8360, obj_type=<value optimized out>, obj=0x12b378, prerollable=<value optimized out>)

    at gstbasesink.c:3576

#8  0x2be532c0 in gst_base_sink_chain_unlocked (basesink=0xc8360, obj_type=<value optimized out>, obj=0x12b378) at gstbasesink.c:3576

#9  0x2be5375c in gst_base_sink_chain_main (basesink=0xc8360, pad=0xc7000, obj_type=<value optimized out>, obj=0x12b378) at gstbasesink.c:3576

#10 0x2ab69690 in gst_pad_push (pad=0x129e40, buffer=0x12b378) at gstpad.c:249

#11 0x35745420 in gst_queue_loop (pad=<value optimized out>) at gstqueue.c:443

#12 0x2ab95750 in gst_task_func (task=0x122e40) at gsttask.c:207

#13 0x2ab96c50 in default_func (tdata=<value optimized out>, pool=<value optimized out>) at gsttaskpool.c:70

#14 0x2ac5b85c in g_thread_pool_thread_proxy (data=<value optimized out>) at gthreadpool.c:726

#15 0x2ac5957c in g_thread_create_proxy (data=0x111598) at gthread.c:180

#16 0x2ad80b10 in start_thread () from /lib/libpthread.so.0

#17 0x2bd98958 in clone () from /lib/libc.so.6

(gdb) thread 8

[Switching to thread 8 (Thread 949851232 (LWP 5558))]#0  0x2bd40148 in _int_free () from /lib/libc.so.6

(gdb) bt

#0  0x2bd40148 in _int_free () from /lib/libc.so.6

#1  0x2bd43dc0 in free () from /lib/libc.so.6

#2  0x2ac395c0 in IA__g_free (mem=0x38c7be30) at gmem.c:338

#3  0x2ab33584 in gst_buffer_finalize (buffer=0x362fd110) at gstbuffer.c:311

#4  0x2ab5c594 in gst_mini_object_unref (mini_object=0x362fd110) at gstminiobject.c:604

#5  0x2be51dd8 in gst_base_sink_render_object (basesink=0xd2908, obj_type=<value optimized out>, obj=0x389d8940) at gstbasesink.c:3576

#6  0x2be52e58 in gst_base_sink_queue_object_unlocked (basesink=0xd2908, obj_type=<value optimized out>, obj=0x362fd110, prerollable=<value optimized out>)

    at gstbasesink.c:3576

#7  0x2be532c0 in gst_base_sink_chain_unlocked (basesink=0xd2908, obj_type=<value optimized out>, obj=0x362fd110) at gstbasesink.c:3576

#8  0x2be5375c in gst_base_sink_chain_main (basesink=0xd2908, pad=0x10e0c8, obj_type=<value optimized out>, obj=0x362fd110) at gstbasesink.c:3576

#9  0x2ab69690 in gst_pad_push (pad=0x10a1d0, buffer=0x362fd110) at gstpad.c:249

#10 0x2ab69690 in gst_pad_push (pad=0x10e708, buffer=0x362fd110) at gstpad.c:249

#11 0x2be63568 in gst_base_transform_chain (pad=<value optimized out>, buffer=<value optimized out>) at gstbasetransform.c:1683

#12 0x2ab69690 in gst_pad_push (pad=0x10e578, buffer=0x362fd110) at gstpad.c:249

#13 0x2be63568 in gst_base_transform_chain (pad=<value optimized out>, buffer=<value optimized out>) at gstbasetransform.c:1683

#14 0x2ab69690 in gst_pad_push (pad=0x10e3e8, buffer=0x362fd110) at gstpad.c:249

#15 0x2be63568 in gst_base_transform_chain (pad=<value optimized out>, buffer=<value optimized out>) at gstbasetransform.c:1683

#16 0x2ab69690 in gst_pad_push (pad=0x10e258, buffer=0x362fd110) at gstpad.c:249

#17 0x35745420 in gst_queue_loop (pad=<value optimized out>) at gstqueue.c:443

#18 0x2ab95750 in gst_task_func (task=0x122f50) at gsttask.c:207

#19 0x2ab96c50 in default_func (tdata=<value optimized out>, pool=<value optimized out>) at gsttaskpool.c:70

#20 0x2ac5b85c in g_thread_pool_thread_proxy (data=<value optimized out>) at gthreadpool.c:726

#21 0x2ac5957c in g_thread_create_proxy (data=0x149730) at gthread.c:180

#22 0x2ad80b10 in start_thread () from /lib/libpthread.so.0

#23 0x2bd98958 in clone () from /lib/libc.so.6

(gdb) thread 9

[Switching to thread 9 (Thread 961541216 (LWP 5559))]#0  0x2bd8f794 in poll () from /lib/libc.so.6

(gdb) bt

#0  0x2bd8f794 in poll () from /lib/libc.so.6

#1  0x378bd470 in snd1_pcm_wait_nocheck () from /usr/lib/libasound.so.2

#2  0x00013958 in ?? ()

(gdb) thread 10 bt

A syntax error in expression, near `bt'.

(gdb) thread 10

[Switching to thread 10 (Thread 971826272 (LWP 5560))]#0  0x2ad8565c in pthread_cond_timedwait@@GLIBC_2.4 () from /lib/libpthread.so.0

(gdb) bt

#0  0x2ad8565c in pthread_cond_timedwait@@GLIBC_2.4 () from /lib/libpthread.so.0

#1  0x2ad20038 in g_cond_timed_wait_posix_impl (cond=0x15fa80, entered_mutex=0x2aa20, abs_time=<value optimized out>) at gthread-impl.c:221

#2  0x2ac0b5f0 in g_async_queue_pop_intern_unlocked (queue=0x2aa00, try=0, end_time=0x39ecdd98) at gasyncqueue.c:354

#3  0x2ac5b8a8 in g_thread_pool_thread_proxy (data=<value optimized out>) at gthreadpool.c:726

#4  0x2ac5957c in g_thread_create_proxy (data=0x1613a0) at gthread.c:180

#5  0x2ad80b10 in start_thread () from /lib/libpthread.so.0

#6  0x2bd98958 in clone () from /lib/libc.so.6

(gdb)

My code like that:

bool Player::InitPipe()

{

    if (!is_init_){

        /* initialization */

        gst_init (NULL, NULL);

        printf("gst_init\n");

        is_init_ = true;

    }

    if (NULL == pipeline_) {

        /* create elements */

        GstElement *fakesink;

        pipeline_ = gst_pipeline_new ("pipeline");

        bus_ = gst_pipeline_get_bus (GST_PIPELINE (pipeline_));

        gst_object_unref (bus_);

        /* create elements */

        playbin_ = gst_element_factory_make ("playbin2", "bin");

        fakesink  = gst_element_factory_make ("fakesink", "videosink");

        printf("playbin_ = [%p], fakesink = [%p]\n", playbin_, fakesink);

        if (!playbin_ || !fakesink) {

            g_print ("one element could not be found \n");

            return false;

        }

        /* configure elements */

        g_object_set (G_OBJECT (fakesink), "sync", TRUE, "signal-handoffs", TRUE, NULL);

        g_signal_connect (fakesink, "handoff", G_CALLBACK (CB_Handoff), this);

        g_object_set (G_OBJECT (playbin_), "video-sink", fakesink, NULL);

        gst_bin_add (GST_BIN (pipeline_), playbin_);

    }

    return true;

}

void Player::CB_Handoff(GstElement *object, GstBuffer *buf, GstPad *pad, Player *pThis)

{

    if (pThis != NULL) {

        gst_buffer_ref (buf);

        if (pThis->picture_session_ == NULL) {

            GstStructure *s;

            GstCaps *caps;

            caps = GST_BUFFER_CAPS (buf);

            s = gst_caps_get_structure (caps, 0);

            gst_structure_get_int (s, "width", &(pThis->width_));

            gst_structure_get_int (s, "height", &(pThis->height_));

            guint32 fourcc;

            gst_structure_get_fourcc (s, "format", &fourcc);

            pThis->format_ = gst_gl_vivante_get_gl_format(gst_video_format_from_fourcc(fourcc));

            const GValue *value = gst_structure_get_value(s, "format");

            printf("format value: %s.\n", g_strdup_value_contents(value));

            pThis->buf_size_ = buf->size;

            pThis->InitRender();

        }

        UpdateTextureData(pThis->render_id_, pThis->picture_session_, GST_BUFFER_DATA(buf), pThis->buf_size_, pThis->format_);

        gst_buffer_unref (buf);

    }

}

InitRender like that:

char *GetTexturePtr(GLuint texture, int width, int height, int format, void* data_ptr[])

{

    if (texture == 0) {

        return NULL;

    }

    char *ptr = NULL;

    glBindTexture(GL_TEXTURE_2D, texture);

    if (glGetError() != GL_NO_ERROR) {

        printf("\n\n[%s:%s:%d]glErrno = [%d]\n\n", __FILE__, __FUNCTION__, __LINE__, glGetError());

  return NULL;

  }

    if (-1 == format) {

        format = GL_BGRA_EXT;

    }

    glTexDirectVIV(GL_TEXTURE_2D, width, height, format, (GLvoid **)data_ptr);

    if (glGetError() != GL_NO_ERROR) {

    printf("\n\n[%s:%s:%d]glErrno = [%d]\n\n", __FILE__, __FUNCTION__, __LINE__, glGetError());

    return NULL;

    }

    return ptr;

}

UpdateTextureData like that:

void UpdateTextureData(GLuint texture, void *texPtr[], char *data, int w, int h, int format)

{

    if ((texture == 0)/* || (texPtr == NULL)*/ || (data == NULL)/* || (dataSize < 1)*/) {

        printf("exit:[%s:%s:%d]\n", __FILE__, __FUNCTION__, __LINE__);

        return ;

    }

    glBindTexture(GL_TEXTURE_2D, texture);

    if (glGetError() != GL_NO_ERROR) {

        printf("\n\n[%s:%s:%d]glErrno = [%d]\n\n", __FILE__, __FUNCTION__, __LINE__, glGetError());

        return ;

    }

   

    if (-1 == format) {

  format = GL_BGRA_EXT;

  }

  glTexDirectVIV(GL_TEXTURE_2D, w, h, format, (GLvoid **)texPtr);

  if (glGetError() != GL_NO_ERROR) {

  printf("\n\n[%s:%s:%d]glErrno = [%d]\n\n", __FILE__, __FUNCTION__, __LINE__, glGetError());

  return ;

  }

    copy_data_to_gpu(format, data, texPtr, w, h);

    glTexDirectInvalidateVIV(GL_TEXTURE_2D);

    if (glGetError() != GL_NO_ERROR) {printf("error!\n");}

}

0 Kudos
0 Replies