BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / add-ons / media / media-add-ons / demultiplexer / MediaDemultiplexerAddOn.cpp
bloba215d862b93f4ee0bbb2d4869210c24a060be59d
1 // MediaDemultiplexerAddOn.cpp
2 //
3 // Andrew Bachmann, 2002
4 //
5 // MediaDemultiplexerAddOn is an add-on
6 // that can make instances of MediaDemultiplexerNode
7 //
8 // MediaDemultiplexerNode handles a file and a multistream
11 #include <MediaDefs.h>
12 #include <MediaAddOn.h>
13 #include <Errors.h>
15 #include "MediaDemultiplexerNode.h"
16 #include "MediaDemultiplexerAddOn.h"
18 #include <limits.h>
19 #include <stdio.h>
20 #include <string.h>
22 // instantiation function
23 extern "C" _EXPORT BMediaAddOn * make_media_addon(image_id image)
25 return new MediaDemultiplexerAddOn(image);
28 // -------------------------------------------------------- //
29 // ctor/dtor
30 // -------------------------------------------------------- //
32 MediaDemultiplexerAddOn::~MediaDemultiplexerAddOn()
36 MediaDemultiplexerAddOn::MediaDemultiplexerAddOn(image_id image) :
37 BMediaAddOn(image)
39 fprintf(stderr,"MediaDemultiplexerAddOn::MediaDemultiplexerAddOn\n");
40 refCount = 0;
43 // -------------------------------------------------------- //
44 // BMediaAddOn impl
45 // -------------------------------------------------------- //
47 status_t MediaDemultiplexerAddOn::InitCheck(
48 const char ** out_failure_text)
50 fprintf(stderr,"MediaDemultiplexerAddOn::InitCheck\n");
51 return B_OK;
54 int32 MediaDemultiplexerAddOn::CountFlavors()
56 fprintf(stderr,"MediaDemultiplexerAddOn::CountFlavors\n");
57 return 1;
60 status_t MediaDemultiplexerAddOn::GetFlavorAt(
61 int32 n,
62 const flavor_info ** out_info)
64 fprintf(stderr,"MediaDemultiplexerAddOn::GetFlavorAt\n");
65 if (n != 0) {
66 fprintf(stderr,"<- B_BAD_INDEX\n");
67 return B_BAD_INDEX;
69 flavor_info * infos = new flavor_info[1];
70 MediaDemultiplexerNode::GetFlavor(&infos[0],n);
71 (*out_info) = infos;
72 return B_OK;
75 BMediaNode * MediaDemultiplexerAddOn::InstantiateNodeFor(
76 const flavor_info * info,
77 BMessage * config,
78 status_t * out_error)
80 fprintf(stderr,"MediaDemultiplexerAddOn::InstantiateNodeFor\n");
81 MediaDemultiplexerNode * node
82 = new MediaDemultiplexerNode(info,config,this);
83 if (node == 0) {
84 *out_error = B_NO_MEMORY;
85 fprintf(stderr,"<- B_NO_MEMORY\n");
86 } else {
87 *out_error = node->InitCheck();
89 return node;
92 status_t MediaDemultiplexerAddOn::GetConfigurationFor(
93 BMediaNode * your_node,
94 BMessage * into_message)
96 fprintf(stderr,"MediaDemultiplexerAddOn::GetConfigurationFor\n");
97 MediaDemultiplexerNode * node
98 = dynamic_cast<MediaDemultiplexerNode*>(your_node);
99 if (node == 0) {
100 fprintf(stderr,"<- B_BAD_TYPE\n");
101 return B_BAD_TYPE;
103 return node->GetConfigurationFor(into_message);
106 bool MediaDemultiplexerAddOn::WantsAutoStart()
108 fprintf(stderr,"MediaDemultiplexerAddOn::WantsAutoStart\n");
109 return false;
112 status_t MediaDemultiplexerAddOn::AutoStart(
113 int in_count,
114 BMediaNode ** out_node,
115 int32 * out_internal_id,
116 bool * out_has_more)
118 fprintf(stderr,"MediaDemultiplexerAddOn::AutoStart\n");
119 return B_OK;
122 // -------------------------------------------------------- //
123 // main
124 // -------------------------------------------------------- //
126 int main(int argc, char *argv[])
128 fprintf(stderr,"main called for MediaDemultiplexerAddOn\n");
131 // -------------------------------------------------------- //
132 // stuffing
133 // -------------------------------------------------------- //
135 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_0(void *) {};
136 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_1(void *) {};
137 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_2(void *) {};
138 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_3(void *) {};
139 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_4(void *) {};
140 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_5(void *) {};
141 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_6(void *) {};
142 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_7(void *) {};
143 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_8(void *) {};
144 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_9(void *) {};
145 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_10(void *) {};
146 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_11(void *) {};
147 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_12(void *) {};
148 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_13(void *) {};
149 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_14(void *) {};
150 status_t MediaDemultiplexerAddOn::_Reserved_MediaDemultiplexerAddOn_15(void *) {};