Re: [FFmpeg-devel] [PATCH 6/7] avcodec/internal.h: Move avpriv_find_start_code() to startcode.h

2022-02-05 Thread Andreas Rheinhardt
Scott Theisen:
> On 2/4/22 10:16, Andreas Rheinhardt wrote:
>> This is by definition the appropriate place for it.
>> Remove all the now unnecessary libavcodec/internal.h inclusions;
>> also remove other unnecessary headers from the affected files.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
> 
>>
>> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
>> index b19befef21..c7c7323351 100644
>> --- a/libavcodec/utils.c
>> +++ b/libavcodec/utils.c
>> @@ -27,7 +27,6 @@
>>     #include "config.h"
>>   #include "libavutil/avassert.h"
>> -#include "libavutil/avstring.h"
>>   #include "libavutil/channel_layout.h"
>>   #include "libavutil/intreadwrite.h"
>>   #include "libavutil/mem.h"
>> @@ -40,12 +39,9 @@
>>   #include "thread.h"
>>   #include "internal.h"
>>   #include "put_bits.h"
>> -#include "raw.h"
>> +#include "startcode.h"
>>   #include 
>> -#include 
>> -#include 
>>   #include 
>> -#include 
>>     void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t
>> min_size)
>>   {
> 
> Shouldn't you also move the definition to startcode.c as well? Then
> utils.c doesn't need startcode.h.

startcode.c is only compiled conditionally and the check is done in
configure, so I would have to add new configure dependencies. Yet
configure dependencies only take effect after a reconfigure, but there
is no good way to force a reconfigure (only adding a new codec, filter
or format forces this).
(There is a workaround: Modify the files containing the codecs, filters
or formats lists somehow, but this is not nice.)

- Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 6/7] avcodec/internal.h: Move avpriv_find_start_code() to startcode.h

2022-02-04 Thread Scott Theisen

On 2/4/22 10:16, Andreas Rheinhardt wrote:

This is by definition the appropriate place for it.
Remove all the now unnecessary libavcodec/internal.h inclusions;
also remove other unnecessary headers from the affected files.

Signed-off-by: Andreas Rheinhardt 
---




diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index b19befef21..c7c7323351 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -27,7 +27,6 @@
  
  #include "config.h"

  #include "libavutil/avassert.h"
-#include "libavutil/avstring.h"
  #include "libavutil/channel_layout.h"
  #include "libavutil/intreadwrite.h"
  #include "libavutil/mem.h"
@@ -40,12 +39,9 @@
  #include "thread.h"
  #include "internal.h"
  #include "put_bits.h"
-#include "raw.h"
+#include "startcode.h"
  #include 
-#include 
-#include 
  #include 
-#include 
  
  void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)

  {


Shouldn't you also move the definition to startcode.c as well? Then 
utils.c doesn't need startcode.h.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 6/7] avcodec/internal.h: Move avpriv_find_start_code() to startcode.h

2022-02-04 Thread Andreas Rheinhardt
This is by definition the appropriate place for it.
Remove all the now unnecessary libavcodec/internal.h inclusions;
also remove other unnecessary headers from the affected files.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/cavsdec.c  | 1 +
 libavcodec/cbs_mpeg2.c| 2 +-
 libavcodec/extract_extradata_bsf.c| 3 +--
 libavcodec/h264_parser.c  | 3 +--
 libavcodec/internal.h | 4 
 libavcodec/mpeg12.c   | 6 +-
 libavcodec/mpeg12dec.c| 4 +---
 libavcodec/mpeg4_unpack_bframes_bsf.c | 2 +-
 libavcodec/mpegvideo_parser.c | 2 +-
 libavcodec/remove_extradata_bsf.c | 2 +-
 libavcodec/startcode.h| 4 
 libavcodec/utils.c| 6 +-
 libavcodec/vc1_common.h   | 2 +-
 libavformat/avidec.c  | 2 +-
 libavformat/avs2dec.c | 2 +-
 libavformat/avs3dec.c | 2 +-
 libavformat/cavsvideodec.c| 2 +-
 libavformat/mpegtsenc.c   | 2 +-
 libavformat/mpegvideodec.c| 2 +-
 libavformat/mxfenc.c  | 6 ++
 libavformat/rtpenc_mpv.c  | 2 +-
 21 files changed, 24 insertions(+), 37 deletions(-)

diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 692c77eb39..894aa1b54a 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -32,6 +32,7 @@
 #include "cavs.h"
 #include "internal.h"
 #include "mpeg12data.h"
+#include "startcode.h"
 
 static const uint8_t mv_scan[4] = {
 MV_FWD_X0, MV_FWD_X1,
diff --git a/libavcodec/cbs_mpeg2.c b/libavcodec/cbs_mpeg2.c
index 90d667ddc8..8d45d1ceeb 100644
--- a/libavcodec/cbs_mpeg2.c
+++ b/libavcodec/cbs_mpeg2.c
@@ -21,7 +21,7 @@
 #include "cbs.h"
 #include "cbs_internal.h"
 #include "cbs_mpeg2.h"
-#include "internal.h"
+#include "startcode.h"
 
 
 #define HEADER(name) do { \
diff --git a/libavcodec/extract_extradata_bsf.c 
b/libavcodec/extract_extradata_bsf.c
index dbcb8508b0..027a578af1 100644
--- a/libavcodec/extract_extradata_bsf.c
+++ b/libavcodec/extract_extradata_bsf.c
@@ -18,8 +18,6 @@
 
 #include 
 
-#include "libavutil/common.h"
-#include "libavutil/intreadwrite.h"
 #include "libavutil/log.h"
 #include "libavutil/opt.h"
 
@@ -31,6 +29,7 @@
 #include "h2645_parse.h"
 #include "h264.h"
 #include "hevc.h"
+#include "startcode.h"
 #include "vc1_common.h"
 
 typedef struct ExtractExtradataContext {
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 4002bcad77..50810f1789 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -27,7 +27,6 @@
 
 #define UNCHECKED_BITSTREAM_READER 1
 
-#include 
 #include 
 
 #include "libavutil/avutil.h"
@@ -46,9 +45,9 @@
 #include "h264_ps.h"
 #include "h2645_parse.h"
 #include "h264data.h"
-#include "internal.h"
 #include "mpegutils.h"
 #include "parser.h"
+#include "startcode.h"
 
 typedef struct H264ParseContext {
 ParseContext pc;
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index 72ca1553f6..57a1c6206f 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -285,10 +285,6 @@ int ff_thread_can_start_frame(AVCodecContext *avctx);
 
 int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx);
 
-const uint8_t *avpriv_find_start_code(const uint8_t *p,
-  const uint8_t *end,
-  uint32_t *state);
-
 int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec);
 
 /**
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 58e03c05d4..5520960b74 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -29,18 +29,14 @@
 
 #include "libavutil/attributes.h"
 #include "libavutil/avassert.h"
-#include "libavutil/timecode.h"
 #include "libavutil/thread.h"
 
-#include "internal.h"
 #include "avcodec.h"
 #include "mpegvideo.h"
-#include "error_resilience.h"
 #include "mpeg12.h"
 #include "mpeg12data.h"
 #include "mpegvideodata.h"
-#include "bytestream.h"
-#include "thread.h"
+#include "startcode.h"
 
 static const uint8_t table_mb_ptype[7][2] = {
 { 3, 5 }, // 0x01 MB_INTRA
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 4a7bd6d466..860e86aa74 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -34,14 +34,11 @@
 #include "libavutil/mem_internal.h"
 #include "libavutil/stereo3d.h"
 #include "libavutil/timecode.h"
-#include "libavutil/video_enc_params.h"
 
 #include "avcodec.h"
-#include "bytestream.h"
 #include "error_resilience.h"
 #include "hwconfig.h"
 #include "idctdsp.h"
-#include "internal.h"
 #include "mpeg_er.h"
 #include "mpeg12.h"
 #include "mpeg12data.h"
@@ -49,6 +46,7 @@
 #include "mpegvideo.h"
 #include "mpegvideodata.h"
 #include "profiles.h"
+#include "startcode.h"
 #include "thread.h"
 #include "xvmc_internal.h"
 
diff --git a/libavcodec/mpeg4_unpack_bframes_bsf.c 
b/libavcodec/mpeg4_unpack_bframes_bsf.c
index 6f8595713d..ae2c129d88 100644
--- a/libavcodec/mpeg4_unpack_bframes_