RTP/H264 specific private data.
*/
struct PayloadContext {
- unsigned long cookie; ///< sanity check, to make sure we get the pointer we're expecting.
-
//sdp setup parameters
uint8_t profile_idc; ///< from the sdp setup parameters.
uint8_t profile_iop; ///< from the sdp setup parameters.
#endif
};
-#define MAGIC_COOKIE (0xdeadbeef) ///< Cookie for the extradata; to verify we are what we think we are, and that we haven't been freed.
-#define DEAD_COOKIE (0xdeaddead) ///< Cookie for the extradata; once it is freed.
-
/* ---------------- private code */
static int sdp_parse_fmtp_config_h264(AVStream * stream,
PayloadContext * h264_data,
#ifdef DEBUG
assert(data);
- assert(data->cookie == MAGIC_COOKIE);
#endif
assert(buf);
/* ---------------- public code */
static PayloadContext *h264_new_context(void)
{
- PayloadContext *data =
- av_mallocz(sizeof(PayloadContext) +
- FF_INPUT_BUFFER_PADDING_SIZE);
-
- if (data) {
- data->cookie = MAGIC_COOKIE;
- }
-
- return data;
+ return av_mallocz(sizeof(PayloadContext) + FF_INPUT_BUFFER_PADDING_SIZE);
}
static void h264_free_context(PayloadContext *data)
}
#endif
- assert(data);
- assert(data->cookie == MAGIC_COOKIE);
-
- // avoid stale pointers (assert)
- data->cookie = DEAD_COOKIE;
-
- // and clear out this...
av_free(data);
}
stream = s->streams[st_index];
codec = stream->codec;
- assert(h264_data->cookie == MAGIC_COOKIE);
if (av_strstart(p, "framesize:", &p)) {
char buf1[50];