You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-29 05:57:37 +02:00
h2645_parse: change the AVCodecContext* parameter to void*
This should make it more clear that it is not supposed to be used for anything except logging.
This commit is contained in:
@@ -132,7 +132,7 @@ nsc:
|
|||||||
* @return AVERROR_INVALIDDATA if the packet is not a valid NAL unit,
|
* @return AVERROR_INVALIDDATA if the packet is not a valid NAL unit,
|
||||||
* 0 if the unit should be skipped, 1 otherwise
|
* 0 if the unit should be skipped, 1 otherwise
|
||||||
*/
|
*/
|
||||||
static int hevc_parse_nal_header(H2645NAL *nal, AVCodecContext *avctx)
|
static int hevc_parse_nal_header(H2645NAL *nal, void *logctx)
|
||||||
{
|
{
|
||||||
GetBitContext *gb = &nal->gb;
|
GetBitContext *gb = &nal->gb;
|
||||||
int nuh_layer_id;
|
int nuh_layer_id;
|
||||||
@@ -147,7 +147,7 @@ static int hevc_parse_nal_header(H2645NAL *nal, AVCodecContext *avctx)
|
|||||||
if (nal->temporal_id < 0)
|
if (nal->temporal_id < 0)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
av_log(avctx, AV_LOG_DEBUG,
|
av_log(logctx, AV_LOG_DEBUG,
|
||||||
"nal_unit_type: %d, nuh_layer_id: %dtemporal_id: %d\n",
|
"nal_unit_type: %d, nuh_layer_id: %dtemporal_id: %d\n",
|
||||||
nal->type, nuh_layer_id, nal->temporal_id);
|
nal->type, nuh_layer_id, nal->temporal_id);
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ static int hevc_parse_nal_header(H2645NAL *nal, AVCodecContext *avctx)
|
|||||||
|
|
||||||
|
|
||||||
int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
|
int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
|
||||||
AVCodecContext *avctx, int is_nalff, int nal_length_size)
|
void *logctx, int is_nalff, int nal_length_size)
|
||||||
{
|
{
|
||||||
int consumed, ret = 0;
|
int consumed, ret = 0;
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
|
|||||||
length -= nal_length_size;
|
length -= nal_length_size;
|
||||||
|
|
||||||
if (extract_length > length) {
|
if (extract_length > length) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit size.\n");
|
av_log(logctx, AV_LOG_ERROR, "Invalid NAL unit size.\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -211,10 +211,10 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
ret = hevc_parse_nal_header(nal, avctx);
|
ret = hevc_parse_nal_header(nal, logctx);
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Invalid NAL unit %d, skipping.\n",
|
av_log(logctx, AV_LOG_ERROR, "Invalid NAL unit %d, skipping.\n",
|
||||||
nal->type);
|
nal->type);
|
||||||
}
|
}
|
||||||
pkt->nb_nals--;
|
pkt->nb_nals--;
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
|
|||||||
* Split an input packet into NAL units.
|
* Split an input packet into NAL units.
|
||||||
*/
|
*/
|
||||||
int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
|
int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
|
||||||
AVCodecContext *avctx, int is_nalff, int nal_length_size);
|
void *logctx, int is_nalff, int nal_length_size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Free all the allocated memory in the packet.
|
* Free all the allocated memory in the packet.
|
||||||
|
|||||||
Reference in New Issue
Block a user