00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00032
00033 #ifdef EXTERNAL_TRANSCODING
00034
00035 #ifndef __TRANSCODING_H__
00036 #define __TRANSCODING_H__
00037
00038 #include "zmmf/zmmf.h"
00039 #include "dictionary.h"
00040 #include "object_dictionary.h"
00041
00042 #define SOURCE (-1)
00043 #define OFF 0
00044
00045 typedef enum
00046 {
00047 TR_None,
00048 TR_External,
00049 TR_Remote
00050 } transcoding_type_t;
00051
00052 typedef enum
00053 {
00054 FCC_None,
00055 FCC_Process,
00056 FCC_Ignore
00057 } avi_fourcc_listmode_t;
00058
00060 class TranscodingProfile : public zmm::Object
00061 {
00062 public:
00063 TranscodingProfile(transcoding_type_t tr_type, zmm::String name);
00064
00066 transcoding_type_t getType() { return tr_type; }
00067
00069 void setName(zmm::String name) { this->name = name; }
00070
00072 zmm::String getName() { return name; }
00073
00078 void setTargetMimeType(zmm::String tm) { this->tm = tm; }
00079
00081 zmm::String getTargetMimeType() { return tm; }
00082
00085 void setCommand(zmm::String command) { this->command = command; }
00086
00088 zmm::String getCommand() { return command; }
00089
00096 void setBufferOptions(size_t bs, size_t cs, size_t ifs);
00097
00098 size_t getBufferSize() { return buffer_size; }
00099 size_t getBufferChunkSize() { return chunk_size; }
00100 size_t getBufferInitialFillSize() { return initial_fill_size; }
00101
00111 void setArguments(zmm::String args) { this->args = args; }
00112
00114 zmm::String getArguments() { return args; }
00115
00117 void setFirstResource(bool fr) { first_resource = fr; }
00118 bool firstResource() { return first_resource; }
00119
00126 void addAttribute(zmm::String name, zmm::String value);
00127
00128 zmm::Ref<Dictionary> getAttributes();
00129
00136 void setTheora(bool theora) { this->theora = theora; }
00137 bool isTheora() { return theora; }
00138
00141 void setAcceptURL(bool accept) { accept_url = accept; }
00142 bool acceptURL() { return accept_url; }
00143
00146 void setThumbnail(bool th) { thumbnail = th; }
00147 bool isThumbnail() { return thumbnail; }
00148
00151 void setHideOriginalResource(bool hide) { hide_orig_res = hide; }
00152 bool hideOriginalResource() { return hide_orig_res; }
00153
00162 void setAVIFourCCList(zmm::Ref<zmm::Array<zmm::StringBase> > list,
00163 avi_fourcc_listmode_t mode = FCC_Ignore);
00164
00166 zmm::Ref<zmm::Array<zmm::StringBase> > getAVIFourCCList();
00168 avi_fourcc_listmode_t getAVIFourCCListMode() { return fourcc_mode; }
00169
00171 void setChunked(bool chunked) { force_chunked = chunked; }
00172 bool getChunked() { return force_chunked; }
00173
00175 void setSampleFreq(int freq) { sample_frequency = freq; }
00176 int getSampleFreq() { return sample_frequency; }
00177
00179 void setNumChannels(int chans) { number_of_channels = chans; }
00180 int getNumChannels() { return number_of_channels; }
00181
00183 void setOnlyDVD(bool accept) { dvd_only = accept; }
00184 bool onlyDVD() { return dvd_only; }
00185
00186 protected:
00187 zmm::String name;
00188 zmm::String tm;
00189 zmm::String command;
00190 zmm::String args;
00191 bool first_resource;
00192 bool theora;
00193 bool accept_url;
00194 bool dvd_only;
00195 bool hide_orig_res;
00196 bool thumbnail;
00197 bool force_chunked;
00198 size_t buffer_size;
00199 size_t chunk_size;
00200 size_t initial_fill_size;
00201 transcoding_type_t tr_type;
00202 int number_of_channels;
00203 int sample_frequency;
00204 zmm::Ref<Dictionary> attributes;
00205 zmm::Ref<zmm::Array<zmm::StringBase> > fourcc_list;
00206 avi_fourcc_listmode_t fourcc_mode;
00207 TranscodingProfile();
00208 };
00209
00211 class TranscodingProfileList : public zmm::Object
00212 {
00213 public:
00214 TranscodingProfileList();
00215 void add(zmm::String sourceMimeType, zmm::Ref<TranscodingProfile> prof);
00216 zmm::Ref<ObjectDictionary<TranscodingProfile> > get(zmm::String sourceMimeType);
00217 zmm::Ref<ObjectDictionary<TranscodingProfile> > get(int index);
00218 zmm::Ref<TranscodingProfile> getByName(zmm::String name);
00219 inline int size() { return list->size(); }
00220 protected:
00221
00222
00223
00224 zmm::Ref<ObjectDictionary<ObjectDictionary<TranscodingProfile> > > list;
00225 };
00226
00227 class TranscodingProcess : public zmm::Object
00228 {
00229 public:
00230 TranscodingProcess(pid_t pid, zmm::String fname)
00231 { this->pid = pid; this->fname = fname; }
00232
00233 pid_t getPID() { return pid; }
00234 zmm::String getFName() { return fname; }
00235
00236 protected:
00237 pid_t pid;
00238 zmm::String fname;
00239 };
00240
00241
00242
00243 #endif//__TRANSCODING_H__
00244
00245 #endif//TRANSCODING