[matroska] r979 - trunk/DvdMenuXtractor

[email protected]
Newsgroups gmane.comp.multimedia.matroska.cvs
Message-ID <[email protected]>
Author: robux4
Date: 2004-12-16 16:28:20 +0300 (Thu, 16 Dec 2004)
New Revision: 979

Modified:
   trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
   trunk/DvdMenuXtractor/VobParser.h
Log:
DMX: store the frame size for buttons, in case resizing is used

Modified: trunk/DvdMenuXtractor/DvdMenuXtractor.cpp
===================================================================
--- trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2004-12-15 21:45:06 UTC (rev 978)
+++ trunk/DvdMenuXtractor/DvdMenuXtractor.cpp	2004-12-16 13:28:20 UTC (rev 979)
@@ -645,7 +645,8 @@
 					}
 				}
 				// create a possible button demuxer too
-				_muxer = new BtnDemuxWriter(outputDirectory + newFilename);
+				// _todo_ get image width from somewhere
+				_muxer = new BtnDemuxWriter(outputDirectory + newFilename, 576, 400);
 				if (!demuxer.AddDemuxer(SUBSTREAM_PCI, _muxer))
 					delete _muxer;
 			}

Modified: trunk/DvdMenuXtractor/VobParser.h
===================================================================
--- trunk/DvdMenuXtractor/VobParser.h	2004-12-15 21:45:06 UTC (rev 978)
+++ trunk/DvdMenuXtractor/VobParser.h	2004-12-16 13:28:20 UTC (rev 979)
@@ -425,20 +425,33 @@
 class BtnDemuxWriter : public Demuxer, public Writer
 {
 public:
-	BtnDemuxWriter(const char* filenamePrefix)
+	BtnDemuxWriter(const char* filenamePrefix, uint16_t width, uint16_t height)
 		:Writer(filenamePrefix, "btn",0.0)
+		,m_width(width)
+		,m_height(height)
 		,m_end_timecode(0)
 		,m_last_start_timecode(0)
 		,m_last_end_timecode(0)
 	{}
 	void ProcessStream(uint8_t* buff, uint32_t size, uint32_t start_time, uint32_t end_time, wxString & debug)
 	{
+		if (!m_file) {
+			m_file = OpenOuputFile();
+			fwrite("butonDVD", 8, 1, m_file);
+			uint8_t _tmp[4];
+			_tmp[0] = m_width >> 8;
+			_tmp[1] = m_width & 0xFF;
+			_tmp[2] = m_height >> 8;
+			_tmp[3] = m_height & 0xFF;
+			fwrite(_tmp, 4, 1, m_file);
+		}
 		Write(buff,size, start_time, end_time, debug);
 	}
 	void SetBoundary(uint32_t start_timecode, uint32_t duration, uint16_t vob_id, uint16_t cell_id);
 	~BtnDemuxWriter();
 protected:
 	void WriteTimecodeInfo(uint32_t start_time, uint32_t end_time, uint64_t filepos, wxString & debug);
+	uint16_t m_width, m_height;
 	uint32_t m_start_timecode;
 	uint32_t m_end_timecode;
 	uint32_t m_last_start_timecode;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.