how to change spaces like dvd player? - objective-c

I want to program an application that changes spaces the way DVD Player does on OS X (screenshot of the transition below, but it may not be helpful because I cannot get my timing right). How can I make my application open a window, and move into a different space the way DVD Player does?

That's a new feature in OS X Lion. It's called Fullscreen apps. You'll want to look at the documentation for how to get your app ready for Fullscreen:
http://developer.apple.com/library/mac/#documentation/General/Conceptual/MOSXAppProgrammingGuide/FullScreenApp/FullScreenApp.html

Related

How to capture App Screen as Video with Audio in Mac OSX?

I am writing a MacOS or OSX application where I need to record only the View of my application (Not the Whole display) with the Audio it emits.
Think it as a game app and I need to record the complete GamePlay View Of the Application.How should I go about doing this?
I am aware of "AVCaptureScreenInput" and, the example. But how to capture only the view of my application?
From the website you posted:
Note: By default, AVCaptureScreenInput captures the entire screen. You may set its cropRect property to limit the capture rectangle to a subsection of the screen.
Just set this property to the windows/views rect and you're done
Of course you need to update and restart the recording when the windows/views rect changes.
Read the document carefully, there is a comment, about the displays:
// If you're on a multi-display system and you want to capture a secondary display,
// you can call CGGetActiveDisplayList() to get the list of all active displays.
// For this example, we just specify the main display.
// To capture both a main and secondary display at the same time, use two active
// capture sessions, one for each display. On Mac OS X, AVCaptureMovieFileOutput
// only supports writing to a single video track.

Use OS X to take pictures with camera connected over usb

I'm currently creating an OS X application that makes use of a
camera (Nikon D700) to take pictures. Is there any way to create an application that takes pictures?
For instance: I click on a button in my program, and it takes a picture with the camera, and sends it directly back to the program.
The programming language does not really matter.
Any help or related posts are welcome.
Thanks!
Reense

Windows Desktop Manager Overlay

I like to make an overlay with the following properties:
should work at least on Windows 8.1
should be on top on everything, like a mouse cursor
should incorporate the pixels which are already on the background, like a blur filter
no flickering
Details to each of this points:
1) I assume that WDM is activated and DirectX 11.2 is used. Sure it would be nice to have it working on other Windows versions but this has no priority.
2) The problem is that with simply using the WS_EX_TOPMOST, menus from applications are over my overlay. In my case this really hurts as I like to display something with the same properties as a cursor. Imagine that a cursor suddenly is hidden if you open a menu -> unacceptable.
3) I like to read the pixels from the Windows desktop, including any effect Windows applies (like blur), and use this information for my filter. If I add my overlay, as described in 2, I should be able to get a fresh unobstructed copy of the background in the next frame and not read out my own overlay.
4) If I just write something into the Windows desktop directly, it gets overwritten immediately on the next frame by Windows itself. This is not acceptable.
One example of such an application is a magnifying glass, which exactly has all the properties I need. But for this case Windows 8.1 has an API. In contrast I like to write a program which displays a hand on the desktop (which is controlled by Leap Motion) which influences the Windows desktop, so you almost "feel" how you move your hand over the desktop.
If I write a tiny DirectX and/or OpenGL application for myself this is all very easy:
render all the regular stuff to a texture
use this texture for a post processing filter and add all my stuff on top of it
render just a quad to the back buffer
But I like to do that for the whole Windows desktop.
I found many different application, but they are to no use for me:
application which claim to be on top, are still behind menus. This normally doesn't really hurt, but is unacceptable for a cursor-alike thing
screen capturing programs which hook them self in all running programs are nice, but I want to hook myself into WDM
normally screen capturing programs do not draw anything into the back buffer, so they get every frame a new unobstructed back buffer
My questions can be boiled down to: How can I write my own magnifying glass for Windows 8.1.
I fear that my only serious option is to hook myself into WDM, what I try to avoid.
I'm happy to hear any idea how to achieve this, or hints to application which are doing what I describe.

Mac OS screen as video source

I'm want to create application for OSX where I can record video from webcam and from screen(at the same time or in succession).
In Windows I can use DirectShow and ScreenCapture filter as video source, but in Mac OS we have no DirectShow and filters.
Is it possible to create something like ScreenCapture filter in windows for Mac OS?
Maybe it's must be some video kext or something else.
Can anybody help me with this question?
Thank you.
Apple have an example of recording the screen. Technical Q&A QA1740
How to capture screen activity to a movie file using AV Foundation on
Mac OS X Lion
Q: How do I capture screen activity to a Quicktime movie on Mac OS X
Lion?
I am on mountain lion. With a little tweaking the example works.
EDIT 1* here is a second example from Apple AVScreenShack. Sample Project
Note:I could not get the AVCaptureSessionPresetHigh to work for high quality in either example. Apart from if I set the input's cropRect width & height to anything below 700x700 in the first example.
But the AVCaptureSessionPresetPhoto worked fine and captured the whole screen in good quality.
Edit 2*
Here is Apples sample to record using a device such as an iMac Camera. The sample Project works from the get go.
AVRecorder
have look at here. Get many images and make a video from that images.
Open the QuickTimePlayer (at home in the Applications folder) click: File --> try: New Screen Recording (and play with the other two menu items).
I think it is close to what you want to do.
A new panel will open; play with the triangle at the right side:

Directly Record Screen on Mac

OK so I want to record the screen of a Mac directly to a .mov or .m4v. I've taken a look at Son of Grab from Apple, but I would prefer not to deal with screenshots and individual images and just work with video.
I thought there should be something in QTKit but I can't find it. I know this can be done in OpenGL, but 1) I don't know how and 2) I'd like to avoid that if possible.
Just to elaborate, I am recording from iSight using QTCaptureDeviceInput and (obviously a QTDevice) because I need to solution to work on Snow Leopard.
It seems like there should be a way to just target the screen as the input device for QTMediaTypeVideo.
Any help would be greatly appreciated.
You can use AVFoundation to do screen recording on the Mac. It's only available on 10.7 though.
You can use CGDisplayCreateImage/CGDisplayCreateImageFromRect APIs (10.6+) to obtain still images of screen and then making a movie out of them.
I'm not sure how good will be the performance though.
I have found that when faced with the question, will it be fast enough or not, just give it a try. Do a quick test by gabbing frame after frame say 1000 times and time it. CGDisplayCreateImageFromRect is not that hard to call at all. I have called it for single screen shots of the whole screen when the mouse was clicked, and it hardly slowed my mac down (only a basic dual core machine).
Apple has two samples showing the main two ways this can be done: :-
ScreenSnapshot
SonOfGrab
It would be easy to modify these to do it say 1000 times in a loop!