MythTV  master
transcode.h
Go to the documentation of this file.
1 #include "recordingprofile.h"
2 #include "fifowriter.h"
3 #include "transcodedefs.h"
4 #include "programtypes.h"
5 #include "playercontext.h"
6 
7 class ProgramInfo;
9 class MythPlayer;
10 class RingBuffer;
11 
12 typedef vector<struct kfatable_entry> KFATable;
13 
14 class Transcode : public QObject
15 {
16  public:
17  explicit Transcode(ProgramInfo *pginfo);
18  ~Transcode();
19  int TranscodeFile(
20  const QString &inputname,
21  const QString &outputname,
22  const QString &profileName,
23  bool honorCutList, bool framecontrol, int jobID,
24  const QString& fifodir, bool fifo_info, bool cleanCut, frm_dir_map_t &deleteMap,
25  int AudioTrackNo, bool passthru = false);
26  void ShowProgress(bool val) { showprogress = val; }
27  void SetRecorderOptions(const QString& options) { recorderOptions = options; }
28  void SetAVFMode(void) { avfMode = true; }
29  void SetHLSMode(void) { hlsMode = true; }
30  void SetHLSStreamID(int streamid) { hlsStreamID = streamid; }
31  void SetHLSMaxSegments(int segments) { hlsMaxSegments = segments; }
32  void SetCMDContainer(const QString& container) { cmdContainer = container; }
33  void SetCMDAudioCodec(const QString& codec) { cmdAudioCodec = codec; }
34  void SetCMDVideoCodec(const QString& codec) { cmdVideoCodec = codec; }
35  void SetCMDHeight(int height) { cmdHeight = height; }
36  void SetCMDWidth(int width) { cmdWidth = width; }
37  void SetCMDBitrate(int bitrate) { cmdBitrate = bitrate; }
38  void SetCMDAudioBitrate(int bitrate) { cmdAudioBitrate = bitrate; }
40 
41  private:
42  bool GetProfile(const QString& profileName, const QString& encodingType, int height,
43  int frameRate);
44  void ReencoderAddKFA(long curframe, long lastkey, long num_keyframes);
46  PlayerContext *GetPlayerContext(void) { return ctx; }
47  MythPlayer *GetPlayer(void) { return (ctx) ? ctx->m_player : nullptr; }
48 
49  private:
53 #if CONFIG_LIBMP3LAME
55 #endif
61  QString recorderOptions;
62  bool avfMode;
63  bool hlsMode;
67  QString cmdContainer;
68  QString cmdAudioCodec;
69  QString cmdVideoCodec;
70  int cmdWidth;
71  int cmdHeight;
74 };
75 
76 /* vim: set expandtab tabstop=4 shiftwidth=4: */
void SetCMDWidth(int width)
Definition: transcode.h:36
PlayerContext * ctx
Definition: transcode.h:56
void SetCMDAudioCodec(const QString &codec)
Definition: transcode.h:33
int cmdBitrate
Definition: transcode.h:72
MythPlayer * m_player
PlayerContext * GetPlayerContext(void)
Definition: transcode.h:46
void ReencoderAddKFA(long curframe, long lastkey, long num_keyframes)
Definition: transcode.cpp:86
void SetAVFMode(void)
Definition: transcode.h:28
void SetCMDBitrate(int bitrate)
Definition: transcode.h:37
void SetHLSMaxSegments(int segments)
Definition: transcode.h:31
int hlsMaxSegments
Definition: transcode.h:66
QString cmdContainer
Definition: transcode.h:67
ProgramInfo * m_proginfo
Definition: transcode.h:50
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
Definition: programtypes.h:81
void DisableAudioOnlyHLS(void)
Definition: transcode.h:39
void SetHLSStreamID(int streamid)
Definition: transcode.h:30
bool showprogress
Definition: transcode.h:60
void ShowProgress(bool val)
Definition: transcode.h:26
QString cmdAudioCodec
Definition: transcode.h:68
void SetCMDContainer(const QString &container)
Definition: transcode.h:32
bool hlsDisableAudioOnly
Definition: transcode.h:65
Holds information on recordings and videos.
Definition: programinfo.h:66
void SetPlayerContext(PlayerContext *)
Definition: transcode.cpp:160
int hlsStreamID
Definition: transcode.h:64
void SetCMDHeight(int height)
Definition: transcode.h:35
QString recorderOptions
Definition: transcode.h:61
RecordingProfile * m_recProfile
Definition: transcode.h:51
bool GetProfile(const QString &profileName, const QString &encodingType, int height, int frameRate)
Definition: transcode.cpp:98
void SetRecorderOptions(const QString &options)
Definition: transcode.h:27
int cmdAudioBitrate
Definition: transcode.h:73
int cmdWidth
Definition: transcode.h:70
vector< struct kfatable_entry > KFATable
Definition: transcode.h:10
MythPlayer * GetPlayer(void)
Definition: transcode.h:47
KFATable * kfa_table
Definition: transcode.h:59
FIFOWriter * fifow
Definition: transcode.h:58
QString cmdVideoCodec
Definition: transcode.h:69
int keyframedist
Definition: transcode.h:52
bool avfMode
Definition: transcode.h:62
void SetHLSMode(void)
Definition: transcode.h:29
bool hlsMode
Definition: transcode.h:63
int TranscodeFile(const QString &inputname, const QString &outputname, const QString &profileName, bool honorCutList, bool framecontrol, int jobID, const QString &fifodir, bool fifo_info, bool cleanCut, frm_dir_map_t &deleteMap, int AudioTrackNo, bool passthru=false)
Definition: transcode.cpp:213
Transcode(ProgramInfo *pginfo)
Definition: transcode.cpp:51
void SetCMDVideoCodec(const QString &codec)
Definition: transcode.h:34
Implements a file/stream reader/writer.
void SetCMDAudioBitrate(int bitrate)
Definition: transcode.h:38
int cmdHeight
Definition: transcode.h:71
RingBuffer * outRingBuffer
Definition: transcode.h:57