vfs: check userland buffers before reading them.
[haiku.git] / src / apps / mediaplayer / supplier / MediaFileTrackSupplier.h
blobe1287ec52c9ef1bd07d7a4f58d72967d4d2081bf
1 /*
2 * Copyright 2010, Stephan Aßmus <superstippi@gmx.de>. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef MEDIA_FILE_TRACK_SUPPLIER_H
6 #define MEDIA_FILE_TRACK_SUPPLIER_H
8 #include <vector>
10 #include <Bitmap.h>
11 #include <List.h>
13 #include "TrackSupplier.h"
16 class BMediaFile;
17 using std::vector;
20 class MediaFileTrackSupplier : public TrackSupplier {
21 public:
22 MediaFileTrackSupplier();
23 virtual ~MediaFileTrackSupplier();
25 virtual status_t InitCheck();
27 virtual status_t GetFileFormatInfo(
28 media_file_format* fileFormat);
29 virtual status_t GetCopyright(BString* copyright);
30 virtual status_t GetMetaData(BMessage* metaData);
32 virtual int32 CountAudioTracks();
33 virtual int32 CountVideoTracks();
34 virtual int32 CountSubTitleTracks();
36 virtual status_t GetAudioMetaData(int32 index,
37 BMessage* metaData);
38 virtual status_t GetVideoMetaData(int32 index,
39 BMessage* metaData);
41 virtual AudioTrackSupplier* CreateAudioTrackForIndex(int32 index);
42 virtual VideoTrackSupplier* CreateVideoTrackForIndex(int32 index);
43 virtual const SubTitles* SubTitleTrackForIndex(int32 index);
45 bool AddSubTitles(SubTitles* subTitles);
47 status_t AddMediaFile(BMediaFile* mediaFile);
49 status_t AddBitmap(BBitmap* bitmap);
51 private:
52 vector<BMediaFile*> fMediaFiles;
53 vector<BBitmap*> fBitmaps;
54 BList fAudioTracks;
55 BList fVideoTracks;
56 BList fSubTitleTracks;
60 #endif // MEDIA_FILE_TRACK_SUPPLIER_H