Esempio n. 1
0
int		old_main (int argc, char** argv)
{
	IDeckLinkIterator*		deckLinkIterator;
	IDeckLink*				deckLink;
	int						numDevices = 0;
	HRESULT					result;
	
	// Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
	deckLinkIterator = CreateDeckLinkIteratorInstance();
	if (deckLinkIterator == NULL)
	{
		fprintf(stderr, "A DeckLink iterator could not be created.  The DeckLink drivers may not be installed.\n");
		return 1;
	}
	
	// Enumerate all cards in this system
	while (deckLinkIterator->Next(&deckLink) == S_OK)
	{
		char *		deviceNameString = NULL;
		
		// Increment the total number of DeckLink cards found
		numDevices++;
		if (numDevices > 1)
			printf("\n\n");
		
		// *** Print the model name of the DeckLink card
		result = deckLink->GetModelName((const char **) &deviceNameString);
		if (result == S_OK)
		{
			printf("=============== %s ===============\n\n", deviceNameString);
			free(deviceNameString);
		}

		print_attributes(deckLink);
		
		// ** List the video output display modes supported by the card
		print_output_modes(deckLink);
		
		// ** List the video input display modes supported by the card
		print_input_modes(deckLink);
		
		// ** List the input and output capabilities of the card
		print_capabilities(deckLink);
		
		// Release the IDeckLink instance when we've finished with it to prevent leaks
		deckLink->Release();
	}
	
	deckLinkIterator->Release();

	// If no DeckLink cards were found in the system, inform the user
	if (numDevices == 0)
		printf("No Blackmagic Design devices were found.\n");
	printf("\n");
	
	return 0;
}
Esempio n. 2
0
int usage(int status)
{
    HRESULT result;
    IDeckLinkIterator *deckLinkIterator;
    IDeckLink *deckLink;
    int numDevices = 0;

    fprintf(stderr,
            "Usage: bmdcapture -m <mode id> [OPTIONS]\n"
            "\n"
            "    -m <mode id>:\n"
            );

    // Create an IDeckLinkIterator object to enumerate all DeckLink cards in the system
    deckLinkIterator = CreateDeckLinkIteratorInstance();
    if (deckLinkIterator == NULL) {
        fprintf(
            stderr,
            "A DeckLink iterator could not be created.  The DeckLink drivers may not be installed.\n");
        return 1;
    }

    // Enumerate all cards in this system
    while (deckLinkIterator->Next(&deckLink) == S_OK) {
        BMDProbeString str;
        // Increment the total number of DeckLink cards found
        numDevices++;
        if (numDevices > 1) {
            printf("\n\n");
        }

        // Print the model name of the DeckLink card
        result = deckLink->GetModelName(&str);
        if (result == S_OK) {
            printf("-> %s (-C %d )\n\n",
                   ToStr(str),
                   numDevices - 1);
            FreeStr(str);
        }

        print_input_modes(deckLink);
        // Release the IDeckLink instance when we've finished with it to prevent leaks
        deckLink->Release();
    }
    deckLinkIterator->Release();

    // If no DeckLink cards were found in the system, inform the user
    if (numDevices == 0) {
        printf("No Blackmagic Design devices were found.\n");
    }
    printf("\n");

    fprintf(
        stderr,
        "    -v                   Be verbose (report each 25 frames)\n"
        "    -f <filename>        Filename raw video will be written to\n"
        "    -F <format>          Define the file format to be used\n"
        "    -c <channels>        Audio Channels (2, 8 or 16 - default is 2)\n"
        "    -s <depth>           Audio Sample Depth (16 or 32 - default is 16)\n"
        "    -p <pixel>           PixelFormat (yuv8, yuv10, rgb10)\n"
        "    -n <frames>          Number of frames to capture (default is unlimited)\n"
        "    -M <memlimit>        Maximum queue size in GB (default is 1 GB)\n"
        "    -C <num>             number of card to be used\n"
        "    -S <serial_device>   data input serial\n"
        "    -A <audio-in>        Audio input:\n"
        "                         1: Analog (RCA or XLR)\n"
        "                         2: Embedded Audio (HDMI/SDI)\n"
        "                         3: Digital Audio (AES/EBU)\n"
        "    -V <video-in>        Video input:\n"
        "                         1: Composite\n"
        "                         2: Component\n"
        "                         3: HDMI\n"
        "                         4: SDI\n"
        "                         5: Optical SDI\n"
        "                         6: S-Video\n"
        "    -o <optionstring>    AVFormat options\n"
        "    -w                   Embed a wallclock stream\n"
        "    -d <filler>          When the source is offline draw a black frame or color bars\n"
        "                         0: black frame\n"
        "                         1: color bars\n"
        "Capture video and audio to a file.\n"
        "Raw video and audio can be sent to a pipe to avconv or vlc e.g.:\n"
        "\n"
        "    bmdcapture -m 2 -A 1 -V 1 -F nut -f pipe:1\n\n\n"
        );

    exit(status);
}