comparison libdlna-0.2.3/test-libdlna.c @ 129:4f6d9621ee00

add multi session streaming & add depending librarys. - libupnp-1.6.6 - libdlna-0.2.3
author Naoya OYAMA <naoya.oyama@gmail.com>
date Sun, 10 Oct 2010 15:33:18 +0900
parents
children
comparison
equal deleted inserted replaced
128:3a7d8d2f0585 129:4f6d9621ee00
1 #include <stdlib.h>
2 #include <stdio.h>
3
4 #include "dlna.h"
5
6 int
7 main (int argc, char **argv)
8 {
9 dlna_t *dlna;
10 dlna_profile_t *p;
11 dlna_org_flags_t flags;
12
13 if (argc < 2)
14 {
15 printf ("usage: %s media_filename\n", argv[0]);
16 return -1;
17 }
18
19 flags = DLNA_ORG_FLAG_STREAMING_TRANSFER_MODE |
20 DLNA_ORG_FLAG_BACKGROUND_TRANSFERT_MODE |
21 DLNA_ORG_FLAG_CONNECTION_STALL |
22 DLNA_ORG_FLAG_DLNA_V15;
23
24 printf ("Using %s\n", LIBDLNA_IDENT);
25
26 dlna = dlna_init ();
27 dlna_set_verbosity (dlna, 1);
28 dlna_register_all_media_profiles (dlna);
29
30 p = dlna_guess_media_profile (dlna, argv[1]);
31 if (p)
32 {
33 char *protocol_info;
34
35 printf ("ID: %s\n", p->id);
36 printf ("MIME: %s\n", p->mime);
37 printf ("Label: %s\n", p->label);
38 printf ("Class: %d\n", p->class);
39 printf ("UPnP Object Item: %s\n", dlna_profile_upnp_object_item (p));
40
41 protocol_info = dlna_write_protocol_info (DLNA_PROTOCOL_INFO_TYPE_HTTP,
42 DLNA_ORG_PLAY_SPEED_NORMAL,
43 DLNA_ORG_CONVERSION_NONE,
44 DLNA_ORG_OPERATION_RANGE,
45 flags, p);
46 printf ("Protocol Info: %s\n", protocol_info);
47 free (protocol_info);
48 }
49 else
50 printf ("Unknown format\n");
51
52 dlna_uninit (dlna);
53
54 return 0;
55 }