diff --git a/FastDXT/Makefile b/FastDXT/Makefile index 5b9a388df..d61ee6181 100644 --- a/FastDXT/Makefile +++ b/FastDXT/Makefile @@ -65,7 +65,11 @@ endif CFLAGS=$(CXXFLAGS) `sdl-config --cflags` -I/opt/local/include -default: main example 2dxt lib viewdxt playdxt +# We need just libdxt for ultragrid. Also, there are still some unresolved +# issues building viewdxt and playdxt on some systems +# +# default: main example 2dxt lib viewdxt playdxt +default: main example 2dxt lib main: dxt.o main.o util.o intrinsic.o example: example.o libdxt.o dxt.o util.o intrinsic.o diff --git a/ultragrid/Makefile.in b/ultragrid/Makefile.in index 1bd1d26c4..f7b51eb4e 100644 --- a/ultragrid/Makefile.in +++ b/ultragrid/Makefile.in @@ -36,8 +36,8 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# $Revision: 1.14 $ -# $Date: 2009/01/06 17:04:46 $ +# $Revision: 1.15 $ +# $Date: 2009/04/14 11:49:15 $ # AR = ar @@ -49,6 +49,7 @@ CFLAGS = @DEFS@ @CFLAGS@ @X_CFLAGS@ LIBS = @AUDIO_HW_LIB@ @DVS_LIB@ @DXT_LIB@ @QUICKTIME_LIB@ @SAGE_LIB@ @X_PRE_LIBS@ @X_LIBS@ @X_EXTRA_LIBS@ @MATHLIBS@ @LIBS@ -lm INC = -Isrc -Itest @AUDIO_HW_INC@ @DVS_INC@ @DXT_INC@ @QUICKTIME_INC@ @GL_INC@ @SAGE_INC@ TARGET = bin/uv +BUNDLE = uv.app OBJS = src/bitstream.o \ src/debug.o \ @@ -201,6 +202,7 @@ clean: -rm -f src/video_capture/testcard_image.c src/video_capture/make_testcard -rm -f $(TEST_OBJS) test/run_tests -rm -f ag_plugin/uvReceiverService.zip ag_plugin/uvSenderService.zip + -rm -rf $(BUNDLE) distclean: clean -rm -f Makefile config.status config.cache config.log src/config.h tags @@ -214,6 +216,11 @@ ctags: release: cvs tag release-`cat VERSION | sed "s/\./-/g"` +bundle: all + mkdir -p $(BUNDLE)/Contents/MacOS + cp $(TARGET) $(BUNDLE)/Contents/MacOS/ + echo -n "UltraGrid" > $(BUNDLE)/Contents/PkgInfo + install: cp -v $(TARGET) /usr/local/bin/ rm -rf /usr/local/share/uv-0.3.1 diff --git a/ultragrid/src/main.c b/ultragrid/src/main.c index a92b59568..f18d714bf 100644 --- a/ultragrid/src/main.c +++ b/ultragrid/src/main.c @@ -40,8 +40,8 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Revision: 1.9 $ - * $Date: 2009/03/19 17:21:46 $ + * $Revision: 1.10 $ + * $Date: 2009/04/14 11:49:15 $ * */ @@ -601,7 +601,7 @@ main(int argc, char *argv[]) #endif /* HAVE_SDL */ #endif /* X_DISPLAY_MISSING */ - usleep(200); + usleep(200000); } } diff --git a/ultragrid/src/video_capture/quicktime.c b/ultragrid/src/video_capture/quicktime.c index 80b53576e..d6f4053f8 100644 --- a/ultragrid/src/video_capture/quicktime.c +++ b/ultragrid/src/video_capture/quicktime.c @@ -33,8 +33,8 @@ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Revision: 1.9 $ - * $Date: 2008/04/18 15:34:53 $ + * $Revision: 1.10 $ + * $Date: 2009/04/14 11:49:15 $ * */ @@ -68,6 +68,9 @@ int frames = 0; struct timeval t, t0; + + + /* * Sequence grabber data procedure * The sequence grabber calls the data function whenever any of the grabbers @@ -191,15 +194,12 @@ SeqGrabberModalFilterProc (DialogPtr theDialog, const EventRecord *theEvent, short *itemHit, long refCon) { UNUSED(theDialog); - UNUSED(theEvent); UNUSED(itemHit); - UNUSED(refCon); // Ordinarily, if we had multiple windows we cared about, we'd handle // updating them in here, but since we don't, we'll just clear out // any update events meant for us -/* Boolean handled = false; if ((theEvent->what == updateEvt) && @@ -210,16 +210,54 @@ SeqGrabberModalFilterProc (DialogPtr theDialog, const EventRecord *theEvent, handled = true; } return (handled); -*/ - return false; } + +// SGSettingsDialog with the "Compression" panel removed +OSErr MinimalSGSettingsDialog(SeqGrabComponent seqGrab, SGChannel sgchanVideo, WindowPtr gMonitor) +{ + OSErr err; + Component *panelListPtr = NULL; + UInt8 numberOfPanels = 0; + + ComponentDescription cd = {SeqGrabPanelType, VideoMediaType, 0, 0, 0 }; + Component c = 0; + Component *cPtr = NULL; + + numberOfPanels = CountComponents(&cd); + panelListPtr = (Component *)NewPtr(sizeof(Component) * (numberOfPanels + 1)); + + cPtr = panelListPtr; + numberOfPanels = 0; + CFStringRef compressionCFSTR = CFSTR("Compression"); + do { + ComponentDescription compInfo; + c = FindNextComponent(c, &cd); + if (c) { + Handle hName = NewHandle(0); + GetComponentInfo(c, &compInfo, hName, NULL, NULL); + CFStringRef nameCFSTR = CFStringCreateWithPascalString(kCFAllocatorDefault, (unsigned char *)(*hName), kCFStringEncodingASCII); + if (CFStringCompare(nameCFSTR, compressionCFSTR, kCFCompareCaseInsensitive) != kCFCompareEqualTo) { + *cPtr++ = c; + numberOfPanels++; + } + DisposeHandle(hName); + } + } while (c); + + if (err = SGSettingsDialog(seqGrab, sgchanVideo, numberOfPanels, panelListPtr, seqGrabSettingsPreviewOnly, (SGModalFilterUPP)NewSGModalFilterUPP(SeqGrabberModalFilterProc), (long)gMonitor)) { + return err; + } +} + + /* Initialize the QuickTime grabber */ static int qt_open_grabber(struct qt_grabber_state *s) { + GrafPtr savedPort; WindowPtr gMonitor; - SGModalFilterUPP seqGrabModalFilterUPP; + //SGModalFilterUPP seqGrabModalFilterUPP; assert (s != NULL); assert (s->magic == MAGIC_QT_GRABBER); @@ -229,8 +267,6 @@ qt_open_grabber(struct qt_grabber_state *s) InitCursor(); EnterMovies(); - gMonitor = (WindowPtr)GetNewDialog (1000, nil, (WindowPtr) -1L); // kMonitorDLOGID = 1000 - /****************************************************************************************/ /* Step 1: Create an off-screen graphics world object, into which we can capture video. */ /* Lock it into position, to prevent QuickTime from messing with it while capturing. */ @@ -241,16 +277,6 @@ qt_open_grabber(struct qt_grabber_state *s) pixelFormat = k2vuyPixelFormat; } - if (QTNewGWorld(&(s->gworld), pixelFormat, &(s->bounds), 0, NULL, 0) != noErr) { - debug_msg("Unable to create GWorld\n"); - return 0; - } - - if (!LockPixels(GetPortPixMap(s->gworld))) { - debug_msg("Unable to lock pixels\n"); - return 0; - } - /****************************************************************************************/ /* Step 2: Open and initialise the default sequence grabber. */ s->grabber = OpenDefaultComponent(SeqGrabComponentType, 0); @@ -259,11 +285,18 @@ qt_open_grabber(struct qt_grabber_state *s) return 0; } + gMonitor = GetDialogWindow(GetNewDialog(1000, NULL, (WindowPtr)-1L)); + + GetPort(&savedPort); + SetPort(gMonitor); + if (SGInitialize(s->grabber) != noErr) { debug_msg("Unable to init grabber\n"); return 0; } + SGSetGWorld(s->grabber, GetDialogPort(gMonitor), NULL); + /****************************************************************************************/ /* Specify the destination data reference for a record operation tell it */ /* we're not making a movie if the flag seqGrabDontMakeMovie is used, */ @@ -276,13 +309,13 @@ qt_open_grabber(struct qt_grabber_state *s) return 0; } - if (SGSetGWorld(s->grabber, s->gworld, GetMainDevice()) != noErr) { - debug_msg("Unable to set graphics world\n"); + if (SGSetGWorld(s->grabber, NULL, NULL) != noErr) { + debug_msg("Unable to get gworld from grabber\n"); return 0; } if (SGNewChannel(s->grabber, VideoMediaType, &s->video_channel) != noErr) { - debug_msg ("Unable to open video channel\n"); + debug_msg("Unable to open video channel\n"); return 0; } @@ -312,17 +345,40 @@ qt_open_grabber(struct qt_grabber_state *s) return 0; } - SGPause(s->grabber, true); + if (SGSetChannelPlayFlags(s->video_channel, channelPlayAllData) != noErr) { + debug_msg("Unable to set channel flags\n"); + return 0; + } + +// SGPause(s->grabber, true); SGStartPreview(s->grabber); if (s->video_channel) { // seqGrabModalFilterUPP = (SGModalFilterUPP)NewSGModalFilterUPP(SeqGrabberModalFilterProc); - SGSettingsDialog(s->grabber, s->video_channel, 0, nil, 0L, (SGModalFilterUPP)NewSGModalFilterUPP(SeqGrabberModalFilterProc), (long)(gMonitor)); +// SGSettingsDialog(s->grabber, s->video_channel, 0, nil, 0L, (SGModalFilterUPP)NewSGModalFilterUPP(SeqGrabberModalFilterProc), (long)(gMonitor)); // DisposeSGModalFilterUPP(seqGrabModalFilterUPP); + MinimalSGSettingsDialog(s->grabber, s->video_channel, gMonitor); } - SGUpdate(s->grabber, 0); +// SGUpdate(s->grabber, 0); + + SetPort(savedPort); + + if (QTNewGWorld(&(s->gworld), pixelFormat, &(s->bounds), 0, NULL, 0) != noErr) { + debug_msg("Unable to create GWorld\n"); + return 0; + } + + if (!LockPixels(GetPortPixMap(s->gworld))) { + debug_msg("Unable to lock pixels\n"); + return 0; + } + + if (SGSetGWorld(s->grabber, s->gworld, GetMainDevice()) != noErr) { + debug_msg("Unable to set graphics world\n"); + return 0; + } /****************************************************************************************/ /* Step ?: Set the data procedure, which processes the frames as they're captured. */ @@ -340,7 +396,7 @@ qt_open_grabber(struct qt_grabber_state *s) return 0; } - SGUpdate(s->grabber, 0); +// SGUpdate(s->grabber, 0); return 1; }