git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use new/delete instead of malloc/free
[enigma2.git]
/
lib
/
dvb
/
subtitle.h
diff --git
a/lib/dvb/subtitle.h
b/lib/dvb/subtitle.h
index 6faad507e6eb582444ad0ad6050b81e95f15ce73..fb9c51a209265c4fb79d1c01c06bc3b165ce28b4 100644
(file)
--- a/
lib/dvb/subtitle.h
+++ b/
lib/dvb/subtitle.h
@@
-11,17
+11,17
@@
typedef unsigned char __u8;
struct subtitle_clut_entry
{
__u8 Y, Cr, Cb, T;
struct subtitle_clut_entry
{
__u8 Y, Cr, Cb, T;
+ __u8 valid;
};
struct subtitle_clut
{
unsigned char clut_id;
};
struct subtitle_clut
{
unsigned char clut_id;
- unsigned char size_2, size_4, size_8;
unsigned char CLUT_version_number;
unsigned char CLUT_version_number;
- s
truct s
ubtitle_clut_entry entries_2bit[4];
- s
truct s
ubtitle_clut_entry entries_4bit[16];
- s
truct s
ubtitle_clut_entry entries_8bit[256];
- s
truct s
ubtitle_clut *next;
+ subtitle_clut_entry entries_2bit[4];
+ subtitle_clut_entry entries_4bit[16];
+ subtitle_clut_entry entries_8bit[256];
+ subtitle_clut *next;
};
struct subtitle_page_region
};
struct subtitle_page_region
@@
-29,7
+29,7
@@
struct subtitle_page_region
int region_id;
int region_horizontal_address;
int region_vertical_address;
int region_id;
int region_horizontal_address;
int region_vertical_address;
- s
truct s
ubtitle_page_region *next;
+ subtitle_page_region *next;
};
struct subtitle_region_object
};
struct subtitle_region_object
@@
-45,7
+45,7
@@
struct subtitle_region_object
int foreground_pixel_value;
int background_pixel_value;
int foreground_pixel_value;
int background_pixel_value;
- s
truct s
ubtitle_region_object *next;
+ subtitle_region_object *next;
};
struct subtitle_region
};
struct subtitle_region
@@
-54,13
+54,16
@@
struct subtitle_region
int region_version_number;
int region_height, region_width;
enum depth { bpp2=1, bpp4=2, bpp8=3 } region_depth;
int region_version_number;
int region_height, region_width;
enum depth { bpp2=1, bpp4=2, bpp8=3 } region_depth;
+
ePtr<gPixmap> region_buffer;
int clut_id;
ePtr<gPixmap> region_buffer;
int clut_id;
- struct subtitle_region_object *region_objects;
+ subtitle_region_object *region_objects;
+
+ subtitle_region *next;
-
struct subtitle_region *next
;
+
bool committed
;
};
struct subtitle_page
};
struct subtitle_page
@@
-69,13
+72,13
@@
struct subtitle_page
time_t page_time_out;
int page_version_number;
int pcs_size;
time_t page_time_out;
int page_version_number;
int pcs_size;
- s
truct s
ubtitle_page_region *page_regions;
+ subtitle_page_region *page_regions;
- s
truct s
ubtitle_region *regions;
+ subtitle_region *regions;
- s
truct s
ubtitle_clut *cluts;
+ subtitle_clut *cluts;
- s
truct s
ubtitle_page *next;
+ subtitle_page *next;
};
struct bitstream
};
struct bitstream
@@
-88,34
+91,43
@@
struct bitstream
struct eDVBSubtitleRegion
{
struct eDVBSubtitleRegion
{
- pts_t show_time;
- int timeout;
- ePtr<gPixmap> region;
+ ePtr<gPixmap> m_pixmap;
+ ePoint m_position;
+ eDVBSubtitleRegion &operator=(const eDVBSubtitleRegion &s)
+ {
+ m_pixmap = s.m_pixmap;
+ m_position = s.m_position;
+ return *this;
+ }
+};
+
+struct eDVBSubtitlePage
+{
+ std::list<eDVBSubtitleRegion> m_regions;
+ pts_t m_show_time;
};
class eDVBSubtitleParser
:public iObject, public ePESParser, public Object
{
DECLARE_REF(eDVBSubtitleParser);
};
class eDVBSubtitleParser
:public iObject, public ePESParser, public Object
{
DECLARE_REF(eDVBSubtitleParser);
- struct subtitle_page *pages;
- int current_clut_id, current_clut_page_id;
- int screen_width, screen_height;
- int bbox_left, bbox_top, bbox_right, bbox_bottom;
+ subtitle_page *m_pages;
ePtr<iDVBPESReader> m_pes_reader;
ePtr<eConnection> m_read_connection;
ePtr<iDVBPESReader> m_pes_reader;
ePtr<eConnection> m_read_connection;
- pts_t show_time;
- Signal1<void,const eDVBSubtitleRegion&> m_new_subtitle_region;
+ pts_t m_show_time;
+ Signal1<void,const eDVBSubtitlePage&> m_new_subtitle_page;
+ int m_composition_page_id, m_ancillary_page_id;
public:
eDVBSubtitleParser(iDVBDemux *demux);
virtual ~eDVBSubtitleParser();
public:
eDVBSubtitleParser(iDVBDemux *demux);
virtual ~eDVBSubtitleParser();
- int start(int pid);
- void connectNewRegion(const Slot1<void, const eDVBSubtitleRegion&> &slot, ePtr<eConnection> &connection);
+ int start(int pid, int composition_page_id, int ancillary_page_id);
+ int stop();
+ void connectNewPage(const Slot1<void, const eDVBSubtitlePage&> &slot, ePtr<eConnection> &connection);
private:
private:
- void subtitle_process_line(s
truct s
ubtitle_page *page, int object_id, int line, __u8 *data, int len);
- int subtitle_process_pixel_data(s
truct s
ubtitle_page *page, int object_id, int *linenr, int *linep, __u8 *data);
+ void subtitle_process_line(subtitle_page *page, int object_id, int line, __u8 *data, int len);
+ int subtitle_process_pixel_data(subtitle_page *page, int object_id, int *linenr, int *linep, __u8 *data);
int subtitle_process_segment(__u8 *segment);
void subtitle_process_pes(__u8 *buffer, int len);
int subtitle_process_segment(__u8 *segment);
void subtitle_process_pes(__u8 *buffer, int len);
- void subtitle_clear_screen();
void subtitle_redraw_all();
void subtitle_reset();
void subtitle_redraw(int page_id);
void subtitle_redraw_all();
void subtitle_reset();
void subtitle_redraw(int page_id);