Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > rtmpdump
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 04-24-2013, 01:31 AM
tigershi2000 tigershi2000 is offline
Junior Member
 
Join Date: Apr 2013
Posts: 1
tigershi2000 is on a distinguished road
Default

librtmp RTMP_Read is block, can unblock


debug librtmp:

RTMP_Read-->Read_1_Packet-->RTMP_GetNextMediaPacket
while (!bHasMediaPacket && RTMP_IsConnected(r)
&& RTMP_ReadPacket(r, packet))
{
...
bHasMediaPacket = RTMP_ClientPacket(r, packet);


if (!bHasMediaPacket)
{
RTMPPacket_Free(packet);
}

...
}

there are be block。

can use callback do noblock:


rtmp.h:

typedef struct AVIOInterruptCB {
int (*callback)(void*);
void *opaque;
} AVIOInterruptCB;

typedef struct RTMP
{
...
AVIOInterruptCB interrupt_callback;
...
}

RTMP_Init:
{..
r->interrupt_callback.opaque = NULL;
r->interrupt_callback.callback = NULL;
}



outside use librtmp:
static int decode_interrupt_cb(void *ctx)
{
MYClass *is = (MYClass *)ctx;
return is->abort_request;
}

RTMP* r;
RTMP_Init(r);
r->interrupt_callback.callback = decode_interrupt_cb;
r->interrupt_callback.opaque = this;


if abort_request is true, RTMP_GetNextMediaPacket() break, RTMP_Read is break, can safe exit my application.



I hope it can help you。
Reply With Quote
  #2  
Old 04-24-2013, 09:44 AM
gorilla.maguila gorilla.maguila is offline
Member
 
Join Date: Dec 2012
Posts: 62
gorilla.maguila is on a distinguished road
Default

Re: librtmp RTMP_Read is block, can unblock


Me not understand and why are u mixing aviointerrupt with librtmp. Aviointerrupt makes sense handling callbacks on ffmpeg blocking functions like avformat_find_stream_info not in librtmp
Reply With Quote
Reply Post New Thread
Tags:



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 09:57 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons