<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#CCCCCC">
<div class="moz-cite-prefix">On 5/27/14 12:21 PM, sithruk sana
wrote:<br>
</div>
<blockquote
cite="mid:CA+oSK=ZiJ4OYfx5pHEX9oKTwO+TO4Nyp50BVNRObNc+8iHBMAA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>Thanks for the information. Kindly correct me if my
understand is right ?<br>
<br>
</div>
1) Packet can be of any type 'I', 'P', or 'B' that we
receive from av_read_frame. // that ie compressed packet.
<br>
<br>
</div>
<div> 'I" frame represents the compete frame. <br>
</div>
<div> 'P" frame represents the delta. it requires
either previous 'I' or 'P' frame. <br>
</div>
<div> 'B' frame depends closest preceeding or
following 'I' or 'P' frame<br>
<br>
</div>
<div> So, av_read_frame ( context, packet) <br>
</div>
<div> - Allocates the internal memory and
keeps the compressed packet. <br>
</div>
<div> <br>
</div>
<b> NOTE: We should not free [ av_free_packet (packet) ]
if we are using shallow copy of 'packet' . For instance<br>
</b></div>
<b> keeping this pointer in the AVPacketList to
push into decoding thread. <br>
</b>
<div>
<div>
<div><br>
</div>
2) Whatever the frame we get we send it to
avcodec_decode_video2 (... frameFinished, packet);<br>
</div>
<div> -> This API keeps internally the previous frames
required to decode. if it has sufficient packet to decode,<br>
</div>
<div> it decodes, and sends back saying "You got
complete picture". <br>
<br>
</div>
<div><br>
Kindly correct me if i am wrong?<br>
</div>
</div>
</div>
</blockquote>
<br>
<br>
I can't comment on the veracity of Question 1, if the returned
packets are of those types, but when I feed avcodec_decode_video2
by hand, with my own nalu data, I feed it an entire buffer of IPPPP
packets, and get a frame in return.<br>
<br>
So for Question 2, I have been told that the decoder used to be such
that you could feed it packets one at a time, I then P then P then P
and eventually it would signal that it has a new frame, but in
current versions of the code this behavior is no longer the default,
requires special setup steps to be performed, and may not always
work anymore.<br>
<br>
That is, if I understand your questions correctly.<br>
</body>
</html>