MythTV  master
cutter.h
Go to the documentation of this file.
1 #ifndef CUTTER_H
2 #define CUTTER_H
3 
4 #include <cstdint> // for int64_t
5 #include "libmythbase/programtypes.h" // for frm_dir_map_t
6 #include "libmythtv/deletemap.h" // for DeleteMap
7 
8 // Cutter object is used in performing clean cutting. The
9 // act of cutting is shared between the player and the
10 // transcode loop. The player performs the initial part
11 // of the cut by seeking, and the transcode loop handles
12 // the remaining part by discarding data.
13 class Cutter
14 {
15  public:
16  Cutter() = default;
17  void SetCutList(frm_dir_map_t &deleteMap, PlayerContext *ctx);
19  void Activate(float v2a, int64_t total);
20  void NewFrame(int64_t currentFrame);
21  bool InhibitUseVideoFrame(void);
22  bool InhibitUseAudioFrames(int64_t frames, long *totalAudio);
23  bool InhibitDummyFrame(void);
24  bool InhibitDropFrame(void);
25 
26  private:
27  bool m_active {false};
30  int64_t m_totalFrames {0};
31  int64_t m_videoFramesToCut {0};
32  int64_t m_audioFramesToCut {0};
34  static constexpr uint8_t kMaxLeadIn { 200 };
35  static constexpr uint8_t kMinCut { 20 };
36 };
37 
38 #endif
39 /* vim: set expandtab tabstop=4 shiftwidth=4: */
40 
Cutter::Activate
void Activate(float v2a, int64_t total)
Definition: cutter.cpp:63
Cutter::InhibitDummyFrame
bool InhibitDummyFrame(void)
Definition: cutter.cpp:155
deletemap.h
Cutter::m_foreshortenedCutList
frm_dir_map_t m_foreshortenedCutList
Definition: cutter.h:28
Cutter::kMaxLeadIn
static constexpr uint8_t kMaxLeadIn
Definition: cutter.h:34
frm_dir_map_t
QMap< uint64_t, MarkTypes > frm_dir_map_t
Frame # -> Mark map.
Definition: programtypes.h:117
Cutter::m_audioFramesPerVideoFrame
float m_audioFramesPerVideoFrame
Definition: cutter.h:33
programtypes.h
Cutter::AdjustedCutList
frm_dir_map_t AdjustedCutList() const
Definition: cutter.cpp:58
Cutter::kMinCut
static constexpr uint8_t kMinCut
Definition: cutter.h:35
Cutter::NewFrame
void NewFrame(int64_t currentFrame)
Definition: cutter.cpp:73
Cutter::m_audioFramesToCut
int64_t m_audioFramesToCut
Definition: cutter.h:32
Cutter::m_videoFramesToCut
int64_t m_videoFramesToCut
Definition: cutter.h:31
Cutter::InhibitDropFrame
bool InhibitDropFrame(void)
Definition: cutter.cpp:167
Cutter::InhibitUseAudioFrames
bool InhibitUseAudioFrames(int64_t frames, long *totalAudio)
Definition: cutter.cpp:120
Cutter::m_tracker
DeleteMap m_tracker
Definition: cutter.h:29
PlayerContext
Definition: playercontext.h:49
Cutter::m_totalFrames
int64_t m_totalFrames
Definition: cutter.h:30
Cutter::Cutter
Cutter()=default
Cutter::m_active
bool m_active
Definition: cutter.h:27
Cutter::InhibitUseVideoFrame
bool InhibitUseVideoFrame(void)
Definition: cutter.cpp:100
Cutter::SetCutList
void SetCutList(frm_dir_map_t &deleteMap, PlayerContext *ctx)
Definition: cutter.cpp:11
Cutter
Definition: cutter.h:13
DeleteMap
Definition: deletemap.h:26