Skip to content

Commit 9b67c5a

Browse files
committed
avfilter/ccfifo: Inline trivial functions
Besides being extremly simple this also avoids including ff_ccfifo_ccdetected() unnecessarily (it is only used by decklink). This is possible because this is not avpriv, but duplicated into lavd if necessary. Signed-off-by: Andreas Rheinhardt <[email protected]>
1 parent 71e1da4 commit 9b67c5a

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

libavfilter/ccfifo.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "ccfifo.h"
2525

2626
#define MAX_CC_ELEMENTS 128
27-
#define CC_BYTES_PER_ENTRY 3
2827

2928
struct cc_lookup {
3029
int num;
@@ -89,16 +88,6 @@ int ff_ccfifo_init(CCFifo *ccf, AVRational framerate, void *log_ctx)
8988
return AVERROR(ENOMEM);
9089
}
9190

92-
int ff_ccfifo_getoutputsize(const CCFifo *ccf)
93-
{
94-
return ccf->expected_cc_count * CC_BYTES_PER_ENTRY;
95-
}
96-
97-
int ff_ccfifo_ccdetected(const CCFifo *ccf)
98-
{
99-
return ccf->cc_detected;
100-
}
101-
10291
int ff_ccfifo_injectbytes(CCFifo *ccf, uint8_t *cc_data, size_t len)
10392
{
10493
int cc_608_tuples = 0;

libavfilter/ccfifo.h

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
#include "libavutil/frame.h"
3434
#include "libavutil/fifo.h"
3535

36+
#define CC_BYTES_PER_ENTRY 3
37+
3638
typedef struct CCFifo {
3739
AVFifo *cc_608_fifo;
3840
AVFifo *cc_708_fifo;
@@ -88,7 +90,11 @@ int ff_ccfifo_extractbytes(CCFifo *ccf, uint8_t *data, size_t len);
8890
* an appropriately sized buffer and pass it to ff_ccfifo_injectbytes()
8991
*
9092
*/
91-
int ff_ccfifo_getoutputsize(const CCFifo *ccf);
93+
static inline int ff_ccfifo_getoutputsize(const CCFifo *ccf)
94+
{
95+
return ccf->expected_cc_count * CC_BYTES_PER_ENTRY;
96+
}
97+
9298

9399
/**
94100
* Insert CC data from the FIFO into an AVFrame (as side data)
@@ -113,6 +119,9 @@ int ff_ccfifo_injectbytes(CCFifo *ccf, uint8_t *data, size_t len);
113119
* Returns 1 if captions have been found as a prior call
114120
* to ff_ccfifo_extract() or ff_ccfifo_extractbytes()
115121
*/
116-
int ff_ccfifo_ccdetected(const CCFifo *ccf);
122+
static inline int ff_ccfifo_ccdetected(const CCFifo *ccf)
123+
{
124+
return ccf->cc_detected;
125+
}
117126

118127
#endif /* AVFILTER_CCFIFO_H */

0 commit comments

Comments
 (0)