History

avcodec/codec_internal: Add FFCodec, hide internal part of AVCodec

Up until now, codec.h contains both public and private parts of AVCodec. This exposes the internals of AVCodec to users and leads them into the temptation of actually using them and forces us to forward-declare structures and types that users can't use at all. This commit changes this by adding a new structure FFCodec to codec_internal.h that extends AVCodec, i.e. contains the public AVCodec as first member; the private fields of AVCodec are moved to this structure, leaving codec.h clean.

Andreas Rheinhardt committed 4 years ago

Commit 20f97271 parent a688f3c513 files · +5330 −5260Browse files

Showing the changes to libavcodec/dds.c (1 of 513 files). Show all

Unified · Split

libavcodec/dds.c+6−6
@@ -749,13 +749,13 @@ static int dds_decode(AVCodecContext *avctx, void *data, · 748 unmodified lines
749749 return avpkt->size;
750750 }
751751
752−const AVCodec ff_dds_decoder = {
753− .name = "dds",
754− .long_name = NULL_IF_CONFIG_SMALL("DirectDraw Surface image decoder"),
755− .type = AVMEDIA_TYPE_VIDEO,
756− .id = AV_CODEC_ID_DDS,
752+const FFCodec ff_dds_decoder = {
753+ .p.name = "dds",
754+ .p.long_name = NULL_IF_CONFIG_SMALL("DirectDraw Surface image decoder"),
755+ .p.type = AVMEDIA_TYPE_VIDEO,
756+ .p.id = AV_CODEC_ID_DDS,
757757 .decode = dds_decode,
758758 .priv_data_size = sizeof(DDSContext),
759− .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
759+ .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS,
760760 .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE
761761 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t