Skip to content

Commit

Permalink
remove libavformat/url.h from most headers
Browse files Browse the repository at this point in the history
I'm not sure how to remove it from avformatdecoder.h since it is not a pointer.
It appears to only be used in avformatdecoder.cpp in one place.

mythavformatbuffer: convert private class static into file static.
Somewhat hack-y, but equivalent.
  • Loading branch information
ulmus-scott committed Feb 10, 2022
1 parent c177c31 commit b17a958
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
2 changes: 2 additions & 0 deletions mythtv/libs/libmythtv/decoders/avformatdecoder.h
Expand Up @@ -7,6 +7,8 @@
extern "C" {
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"

#include "libavformat/url.h"
}

#include <QString>
Expand Down
8 changes: 7 additions & 1 deletion mythtv/libs/libmythtv/io/mythavformatbuffer.cpp
Expand Up @@ -2,7 +2,13 @@
#include "io/mythavformatbuffer.h"
#include "mythcorecontext.h"

URLProtocol MythAVFormatBuffer::s_avfrURL;
// FFmpeg
extern "C" {
#include "libavformat/avformat.h"
#include "libavformat/url.h"
}

static URLProtocol s_avfrURL {};

MythAVFormatBuffer::MythAVFormatBuffer(MythMediaBuffer *Buffer)
: m_buffer(Buffer)
Expand Down
9 changes: 3 additions & 6 deletions mythtv/libs/libmythtv/io/mythavformatbuffer.h
Expand Up @@ -4,11 +4,9 @@
// MythTV
#include "io/mythmediabuffer.h"

// FFmpeg
extern "C" {
#include "libavformat/avformat.h"
#include "libavformat/url.h"
}
// forward declare internal FFmpeg structs from "libavformat/url.h"
struct URLContext;
struct URLProtocol;

class MythAVFormatBuffer
{
Expand All @@ -31,6 +29,5 @@ class MythAVFormatBuffer
private:
MythMediaBuffer *m_buffer { nullptr };
bool m_initState { true };
static URLProtocol s_avfrURL;
};
#endif
17 changes: 9 additions & 8 deletions mythtv/libs/libmythtv/io/mythavformatwriter.cpp
Expand Up @@ -19,6 +19,15 @@
*/
#include "io/mythavformatwriter.h"

// FFmpeg
extern "C" {
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "libavutil/imgutils.h"

#include "libavformat/url.h"
}

#include <QtGlobal>
#include <QtEndian>

Expand All @@ -28,14 +37,6 @@
#include "audiooutpututil.h"
#include "mythavutil.h"


// FFmpeg
extern "C" {
#include "libavutil/opt.h"
#include "libavutil/samplefmt.h"
#include "libavutil/imgutils.h"
}

#define LOC QString("AVFW(%1): ").arg(m_filename)
#define LOC_ERR QString("AVFW(%1) Error: ").arg(m_filename)
#define LOC_WARN QString("AVFW(%1) Warning: ").arg(m_filename)
Expand Down

0 comments on commit b17a958

Please sign in to comment.