-
Notifications
You must be signed in to change notification settings - Fork 3
/
listing3.html
executable file
·346 lines (286 loc) · 14.8 KB
/
listing3.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<!-- BEGIN META TAG INFO -->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="home" href="http://developer.apple.com/">
<link rel="find" href="http://developer.apple.com/search/">
<link rel="stylesheet" type="text/css" href="../../documentation/css/adcstyle.css" title="fonts">
<script language="JavaScript" src="../../documentation/js/adc.js" type="text/javascript"></script>
<!-- END META TAG INFO -->
<!-- BEGIN TITLE -->
<title>SimpleVideoOut - /CVideoOutput.h</title>
<!-- END TITLE -->
<script language="JavaScript">
function JumpToNewPage() {
window.location=document.scpopupmenu.gotop.value;
return true;
}
</script>
</head>
<!-- BEGIN BODY OPEN -->
<body>
<!--END BODY OPEN -->
<!-- START CENTER OPEN -->
<center>
<!-- END CENTER OPEN -->
<!-- BEGIN LOGO AND SEARCH -->
<!--#include virtual="/includes/adcnavbar"-->
<!-- END LOGO AND SEARCH -->
<!-- START BREADCRUMB -->
<div id="breadcrumb">
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr>
<td scope="row"><img width="340" height="10" src="images/1dot.gif" alt=""></td>
<td><img width="340" height="10" src="images/1dot.gif" alt=""></td>
</tr>
<tr valign="middle">
<td align="left" colspan="2">
<a href="http://developer.apple.com/">ADC Home</a> > <a href="../../referencelibrary/index.html">Reference Library</a> > <a href="../../samplecode/index.html">Sample Code</a> > <a href="../../samplecode/Carbon/index.html">Carbon</a> > <a href="../../samplecode/Carbon/idxQuickTime-date.html">QuickTime</a> > <A HREF="javascript:location.replace('index.html');">SimpleVideoOut</A> >
</td>
</tr>
<tr>
<td colspan="2" scope="row"><img width="680" height="35" src="images/1dot.gif" alt=""></td>
</tr>
</table>
</div>
<!-- END BREADCRUMB -->
<!-- START MAIN CONTENT -->
<!-- START TITLE GRAPHIC AND INTRO-->
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr align="left" valign="top">
<td><h1><div id="pagehead">SimpleVideoOut</div></h1></td>
</tr>
</table>
<!-- END TITLE GRAPHIC AND INTRO -->
<!-- START WIDE COLUMN -->
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr align="left" valign="top">
<td id="scdetails">
<h2>/CVideoOutput.h</h2>
<form name="scpopupmenu" onSubmit="return false;" method=post>
<p><strong>View Source Code:</strong>
<select name="gotop" onChange="JumpToNewPage();" style="width:340px"><option selected value="ingnore">Select File</option>
<option value="listing1.html">/ChooseMovieClock.h</option>
<option value="listing2.html">/CVideoOutput.cpp</option>
<option value="listing3.html">/CVideoOutput.h</option>
<option value="listing4.html">/CVideoOutputComponent.cpp</option>
<option value="listing5.html">/CVideoOutputComponent.h</option>
<option value="listing6.html">/GetFile.c</option>
<option value="listing7.html">/GetFile.h</option>
<option value="listing8.html">/plist_carb.r</option>
<option value="listing9.html">/SimpleVideoOut.c</option>
<option value="listing10.html">/SimpleVideoOut_prefix.h</option>
<option value="listing11.html">/SimpleVideoOutMachO_prefix.h</option></select>
</p>
</form>
<p><strong><a href="SimpleVideoOut.zip">Download Sample</a></strong> (“SimpleVideoOut.zip”, 330.7K)<BR>
<strong><a href="SimpleVideoOut.dmg">Download Sample</a></strong> (“SimpleVideoOut.dmg”, 395.5K)</p>
<!--
<p><strong><a href="#">Download Sample</a></strong> (“filename.sit”, 500K)</p>
-->
</td>
</tr>
<tr>
<td scope="row"><img width="680" height="10" src="images/1dot.gif" alt=""><br>
<img height="1" width="680" src="images/1dot_919699.gif" alt=""><br>
<img width="680" height="20" src="images/1dot.gif" alt=""></td>
</tr>
<tr>
<td scope="row">
<!--googleon: index -->
<pre class="sourcecodebox">/* File: CVideoOutput.h Description: CVideoOutput is an easy to use class which encapsulates the basic set of methods required to use QuickTime Video Output Components. The most common use is playing DV streams (.dv files) out to FireWire devices. Author: QuickTime Engineering Version: 2.0.2 Copyright: © Copyright 2000-2002 Apple Computer, Inc. All rights reserved. Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Computer, Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Change History (most recent first): <4> 06/14/02 Begin now takes a boolean to control setting the echo port <3> 11/16/01 initial release version 2.0 <2> 10/19/01 updated to support multiple components <1> 01/28/00 initial release*//* CVideoOutput( const unsigned char inClientNameStr[], const Movie inMovie = NULL ) To instantiate a CVideoOutput object pass in a client name and a Movie, or don't pass in a Movie and call SetMovie() before calling Begin(). inMovie is set to NULL in the interface by default. Open( void ) Opens an instance of a video output component, registers the client name with the component and sets up the display mode. Begin( Boolean inUseVOsdev = true, Boolean inUseVOClk = true, AudioRate inAudioRate = eAudioRateDefault, Boolean inChangeMovieGWorld = false ) Gains exclusive access to the hardware, and sets up the sound output and clock associated with the video output component. Begin also acquires the GWorld used by the video output component. Both the sound and clock parameters are set to 'true' by default, the audio rate is set to "eAudioRateDefault" and Begin will not set the Video Output echo port or call SetMovieGWorld by default, allowing the client of this class to call SetEchoPort when needed. SetMovie( const Movie inMovie ) Set's the Movie to be used by this class. CVideoOutput must have a valid movie before Begin() is called. SetEchoPort( const CGrafPtr inEchoPort = NULL ) Allows you to display video both on an external video display and in a window. Pass in a CGrafPtr to specify a window to display video sent to the device. When the Echo Port is on, the movie is displayed in the window and sent to the video output device. If the EchoPort is not supported by the video output component or is turned off, the Movie will only directed to the video output components GWorld as you would expect. Call CanDoEchoPort() before assuming the video output component supports the echo port. SetSoundDevice( Boolean inUseVOsdev = true ) This call will turn on/off the use of the video output components sound device. Passing in 'true' will set up the use of the video output components sound device, this is the default setting. You should call SetClock() after this call to choose the correct clock. SetClock( Boolean inUseVOClock = true ) Allows you to choose which clock to use for audio / video sync. Passing in 'true' will choose the video output components clock to synchronize video and sound to the rate of the display. Passing in 'false' will use the default QuickTime clock. NOTE: Setting the Movie master clock to the video output clock MUST be done after setting up the sound device or it's gets whacked back to the default QuickTime clock. End( void ) Relinquishes exclusive access to the hardware. Also called by Close(). Close( void ) Closes the component instance and zeros the object. It is also called by the destructor. GetGWorld( void ) Returns a pointer to the graphics world used by a video output component. NOTE: Do NOT dispose this GWorld! GetError( void ) Returns the last return code generated by the system. SelectVideoOutputComponent( void ) Calls the CVideoOutputComponents DoSettingsDialog() method. Allows the client of this class to select which video output component and mode to use. Boolean CanDoEchoPort( void ) Does this component support an EchoPort? Boolean HasSoundOutput( void ) Does this component have a sound output component associated with it? Boolean HasClock( void ) Does this component have a clock component associated with it? */#ifndef __CVIDEOOUTPUT_H__ #define __CVIDEOOUTPUT_H__#if __APPLE_CC__ || __MACH__ #include <Carbon/Carbon.h> #include <QuickTime/QuickTime.h>#else #include <Carbon.h> #include <QuickTimeComponents.h> #include <MediaHandlers.h>#endif#include <memory>#include "GetFile.h"#include "CVideoOutputComponent.h"#include "ChooseMovieClock.h"namespace dts {const UInt8 kMaxAudioTracks = 5;const UInt16 kQTVersion501 = 0x0501;enum AudioRate { eAudioRate48khz = (long)0xBB800000, /* 48000.00000 in fixed-point */ eAudioRate44khz = (long)0xAC440000, /* 44100.00000 in fixed-point */ eAudioRate32khz = (long)0x7D000000, /* 32000.00000 in fixed-point */ eAudioRateDefault = 0L /* use default sampling rate of the media */}; class CVideoOutput { public: explicit CVideoOutput( const unsigned char inClientNameStr[], const Movie inMovie = NULL ); ~CVideoOutput() { Close(); } OSErr Open( void ); void Close( void ); OSErr Begin( Boolean inUseVOsdev = true, Boolean inUseVOClock = true, AudioRate inAudioRate = eAudioRateDefault, Boolean inChangeMovieGWorld = false ); void End( void ); void SetMovie( const Movie inMovie ) { if ( mVideoOutputInUse == false ) mMovie = inMovie; } OSErr SetEchoPort( const CGrafPtr inEchoPort = NULL ); OSErr SetSoundDevice( Boolean inUseVOsdev = true ); void SetClock( Boolean inUseVOClock = true ); const GWorldPtr GetGWorld( void ) const { if ( mVideoOutputInUse == true ) return mVOutputGWorld; else return NULL; } OSErr GetError( void ) const { return rc; } OSErr SelectVideoOutputComponent( void ) { return ( mVOutputComponent->DoSettingsDialog() ); } Boolean CanDoEchoPort( void ) const { return mCanDoEchoPort; } Boolean HasSoundOutput( void ) const { return mHasSoundOutput; } Boolean HasClock( void ) const { return mHasClock; } private: // nope CVideoOutput( const CVideoOutput &inVOObject ); CVideoOutput operator=( CVideoOutput inVOObject ); private: Str255 mClientNameStr; Movie mMovie; CVideoOutputComponentPtr mVOutputComponent; // auto_ptr object, deletion will be handled for us GWorldPtr mVOutputGWorld; Component mSoundOutComponent; ComponentInstance mVideoOutputClockInstance; MediaHandler mAudioMediaHandler[kMaxAudioTracks]; UInt8 mNumberAudioTracks; Boolean mVideoOutputInUse; Boolean mCanDoEchoPort; Boolean mHasSoundOutput; Boolean mHasClock; UInt16 mQTVersion; ComponentResult rc;};} // namespace#endif // __CVIDEOOUTPUT_H__</pre>
<!--googleoff: index -->
</td>
</tr>
</table>
<!-- END WIDE COLUMN -->
<!-- END MAIN CONTENT -->
<table width="680" border="0" cellpadding="0" cellspacing="0">
<tr>
<td><div style="width: 100%; height: 1px; background-color: #919699; margin-top: 5px; margin-bottom: 15px"></div></td>
</tr>
<tr>
<td align="center"><br/>
<table border="0" cellpadding="0" cellspacing="0" class="graybox">
<tr>
<th>Did this document help you?</th>
</tr>
<tr>
<td>
<div style="margin-bottom: 8px"><a href="http://developer.apple.com/feedback/?v=1&url=/samplecode/SimpleVideoOut/listing3.html%3Fid%3DDTS10000809-1.0&media=dvd" target=_new>Yes</a>: Tell us what works for you.</div>
<div style="margin-bottom: 8px"><a href="http://developer.apple.com/feedback/?v=2&url=/samplecode/SimpleVideoOut/listing3.html%3Fid%3DDTS10000809-1.0&media=dvd" target=_new>It’s good, but:</a> Report typos, inaccuracies, and so forth.</div>
<div><a href="http://developer.apple.com/feedback/?v=3&url=/samplecode/SimpleVideoOut/listing3.html%3Fid%3DDTS10000809-1.0&media=dvd" target=_new>It wasn’t helpful</a>: Tell us what would have helped.</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- START BOTTOM APPLE NAVIGATION -->
<!--#include virtual="/includes/footer"-->
<!-- END BOTTOM APPLE NAVIGATION -->
<!-- START CENTER CLOSE -->
</center>
<!-- END CENTER CLOSE -->
</body>
</html>