/////////////////////////////////////////////////////////////////////////////// // The following things were found by means of "revenge", "strings" and // load_add_on()/get_image_symbol() on the Be's binary "bt848.media_addon". /////////////////////////////////////////////////////////////////////////////// //--- Source's file names: //------------------------ // 19x: GCC: (GNU) 2.9-beos-991026, meaning: // 16 source files plus: init_term_dyn.c, crtbegin.o, crtend.o bt848addon.cpp Bt848Controllable.cpp Bt848Source.cpp Bt848AudioMux.cpp Bt848I2C.cpp Bt848Tuner.cpp Bt848VideoControls.cpp Bt848VideoMux.cpp AudioMux.cpp I2CBus.cpp Tuner.cpp VideoControls.cpp VideoConversions.cpp VideoImage.cpp VideoMux.cpp VideoSource.cpp BT848Addon <--| BT848Controllable // Tables on bt848.media_addon: // ============================= const char* kVideoFormat[] = { "Unknown", "NTSC-M", "NTSC-J", "PAL-BDGHI", "PAL-M", "PAL-N", // Missing PAL-Nc ? "SECAM" } const char* kTunerLocale[] = { "Unknown", "Australia Air", "Brazil Air", // really necessary? "China Air", "Europe Air", "Europe Cable", "France Air", "France Cable", "Great Britain Air", "Great Britain Cable", "Japan Air", "Japan Cable", "US Air", // These "US" are used all across the American continent. "US Cable", // IRC = Intercarrier Related Channels "US Cable HRC", // HRC = Harmonically Related Channels "FM Radio" } const char* kTunerBrand[] = { "No Tuner", "Alps", "Panasonic", "Philips", "Temic" } const char* kVideoSourceName[] = { "None" "Composite 1", "Composite 2", "Composite 3", "Composite 4", "Tuner", "SVideo", "Camera" // Surveillance cards? } const char* kAudioSourceName[] = { "Mute", "External Jack", "Internal Jack", "Radio", "Microphone", "Main", "Second", "Both" } const char* kAudioMode[] = { "US NTSC FM", "PAL B/G FM", "PAL B/G NICAM", "PAL I NICAM", "FM RADIO", "Satellite FM Mono" } const char* kMspMode[] = { "AM (type 1)", "AM (type 2)" } const char* kImageSize[] = { "768x576", "720x576", "720x480", "640x480", "352x240", "320x240", "160x120" } const char* kColorspace[] = { "8 Bits/Pixel (Gray)", "15 Bits/Pixel", "16 Bits/Pixel", "32 Bits/Pixel" } // These tables hold a name/frequencies pairs. //---------------------------------------------------------------- typedef struct channel { const char* name; uint32 freq; // in Hz } channel* USNtscAir[] = { { "2", 55250000 }, // ... { "69", 801250000 } } channel* USNtscCableIRC[] = { { "1", 73250000 }, // ... { "125", 799250000 } } channel* USNtscCableHRC[] = { { "1", 72000000 }, // ... { "125", 798000000 } } // And the rest: channel* JapanNtscAir[] channel* JapanNtscCable[] channel* EuropePalAir[] channel* EuropePalCable[] channel* GreatBritainPalAir[] channel* GreatBritainPalCable[] channel* FranceSecamAir[] channel* FranceSecamCable[] channel* ChinaPalAir[] channel* BrazilPalAir[] channel* AustraliaPalAir[] // Believe it or Not: it's stored this way in the addon!!! channel* FmRadio[] = { { "64.0", 64000000 }, // ... { "108.0", 108000000 } } // What's in here? RGB8Map // sizeof(RGB8MAP) == 1024 // looks like a conversion table. //------------------------------------------------------------------------------ // // Classes on bt848.media_addon: // ============================= // // The scope of methods is just my guess. Ditto for most return types. // //------------------------------------------------------------------------------ class BAudioMux { public: BAudioMux(const char* name); virtual ~BAudioMux(); const char* Name() const { return fName; }; uint32 Source() const { return fSource; }; void SetSource(uint32 source); uint32 NumberInputs() const; void Mute(); void Unmute(); private: void SetMute(uint32); void SetShift(uint32); virtual void _ReservedAudioMux1(); virtual void _ReservedAudioMux2(); virtual void _ReservedAudioMux3(); const char* fName; uint32 fSource; } class Bt848AudioMux { public: Bt848AudioMux(const char* name, uint32 , bt848_config* ); virtual ~Bt848AudioMux(); uint32 NumberInputs() const; SetSource(uint32); void Mute(); void Unmute(); private: void SetMute(uint32); void SetShift(uint32); } //------------------------------------------------------------------------------ class BI2CBus { public: BI2CBus(const char* name); virtual ~BI2CBus(); const char* Name() { return fName; }; bool I2CDevicePresent(uint8 address) { return false; }; int I2CReadByte(bool) { return 0; }; int I2CSendByte(uint8 value, bigtime_t timeout); { return 0; }; protected: int I2CRead(uint8 address) { return 0; }; void I2CWrite1(uint8 address, uint8 value) { }; void I2CWrite2(uint8 address, uint8 , uint8 ) { }; private: virtual int I2CAck() = 0; virtual int I2CStatus() = 0; virtual void I2COne() = 0; virtual void I2CZero() = 0; virtual void I2CReset() = 0; virtual void I2CStart() = 0; virtual void I2CStop() = 0; virtual void _ReservedI2CBus1(); virtual void _ReservedI2CBus2(); virtual void _ReservedI2CBus3(); const char* fName; } class Bt848I2C { public: Bt848I2C(const char* name, long, bt848_config* ); virtual ~Bt848I2C(); bool I2CDevicePresent(uint8 address); int I2CReadByte(bool); int I2CSendByte(uint8, bigtime_t timeout); protected: int I2CRead(uint8 address); int I2CWrite1(uint8, uint8); int I2CWrite2(uint8, uint8, uint8); private: int I2CAck(); int I2CStatus(); void I2COne(); void I2CZero(); void I2CReset(); void I2CStart(); void I2CStop(); void I2CBits(); void I2CSetBits(uint8 scl, uint8 sda) } //------------------------------------------------------------------------------ class BTuner { public: BTuner(const char* name); virtual ~BTuner(); const char* Name() { return fName; }; bool FMRadioCapable() const { return false; }; bool TVCapable() const { return false; }; bool BTSCSAPCapable() const { return false; }; bool BTSCStereoCapable() const { return false; }; uint8 BTSCAudioMode() { return fBTSAudioMode; }; void SetBTSCAudioMode(uint8); bool BTSCSAPPresent() { return false; }; bool BTSCStereoPresent() { return false; }; uint32 CurrentFrequency() const { return fCurrentFreq; }; uint32 CurrentIndex() const { return fCurrentIndex; }; bool TunerLocked() { return false; }; int TunerStatus() { return 0; }; uint32 FrequencyFor(uint32 channel_index) const; uint32 FrequencyFor(char* channel_name) const; uint32 IndexForChannelName(char* channel_name) const; char* ChannelNameForIndex(uint32 channel_index) const; uint32 NumberChannels() const; void NextChannel(); void PreviousChannel(); void FineTuneDown(); void FineTuneUp(); void ScanDown(); void ScanUp(); bool ValidFrequency(uint32 frequency) const; tuner_locale TunerLocale() const { return fTunerLocale; }; status_t SetTunerLocale(tuner_locale); status_t Tune(uint32 frequency); status_t Tune(char* channel_name); status_t TuneIndex(uint32 index); private: virtual void _ReservedTuner1(); virtual void _ReservedTuner2(); virtual void _ReservedTuner3(); const char* fName; uint32 fCurrentFreq; uint32 fCurrentIndex; tuner_locale fTunerLocale; uint8 fBTSAudioMode; } //------------------------------------------------------------------------------ class Bt848Tuner { public: Bt848Tuner(const char* name, uint32 , bt848_config* , hw_info* , BI2CBus* i2c_bus, BAudioMux* audio_mux); virtual ~Bt848Tuner(); uint32 CurrentFrequency() const; uint32 CurrentIndex() const; void FineTuneDown(); void FineTuneUp(); void NextChannel(); void PreviousChannel(); void ScanDown(); void ScanUp(); status_t Tune(char* channel_name); status_t Tune(uint32 frequency); status_t TuneIndex(uint32 index); bool TunerLocked(); int TunerStatus(); bool VideoPresent(); } //------------------------------------------------------------------------------ class BVideoControls { public: BVideoControls(const char* name); virtual ~BVideoControls(); const char* Name() { return fName; }; virtual int32 Brightness() const = 0; virtual int32 Contrast() const = 0; virtual int32 Hue() const = 0; virtual int32 Saturation() const = 0; virtual bool ChromaCombFilter() const = 0; virtual bool ErrorDiffusion() const = 0; virtual bool GammaCorrectionRemoval() const = 0; virtual bool LumaCombFilter() const = 0; virtual bool LumaCoring() const = 0; virtual void SetBrightness(int32 value) = 0; virtual void SetContrast(int32 value) = 0; virtual void SetHue(int32 value) = 0; virtual void SetSaturation(int32 value) = 0; virtual void SetChromaCombFilter(bool enabled) = 0; virtual void SetErrorDiffusion(bool enabled) = 0; virtual void SetGammaCorrectionRemoval(bool enabled) = 0; virtual void SetLumaCombFilter(bool enabled) = 0; virtual void SetLumaCoring(bool enabled) = 0; private: virtual void _ReservedVideoControls1(); virtual void _ReservedVideoControls2(); virtual void _ReservedVideoControls3(); const char* fName; } //------------------------------------------------------------------------------ class Bt848VideoControls { public: Bt848VideoControls(const char* name, long , bt848_config* ) virtual ~Bt848VideoControls() int32 Brightness() const { return fBrightness; } int32 Contrast() const { return fContrast; } int32 Hue() const { return fHue; } int32 Saturation() const { return fSaturation; } bool ChromaCombFilter() const { return fChromaCombFilter; } bool ErrorDiffusion() const { return fErrorDiffusion; } bool GammaCorrectionRemoval() const { return fGammaCorrectionRemoval; } bool LumaCombFilter() const { return fLumaCombFilter; } bool LumaCoring() const { return fLumaCoring; } virtual void SetBrightness(int32 value); virtual void SetContrast(int32 value); virtual void SetHue(int32 value); virtual void SetSaturation(int32 value); virtual void SetChromaCombFilter(bool enabled); virtual void SetErrorDiffusion(bool enabled); virtual void SetGammaCorrectionRemoval(bool enabled); virtual void SetLumaCombFilter(bool enabled); virtual void SetLumaCoring(bool enabled); private: int32 fBrightness; int32 fContrast; int32 fHue; int32 fSaturation; bool fChromaCombFilter; bool fErrorDiffusion; bool fGammaCorrectionRemoval; bool fLumaCombFilter; bool fLumaCoring; } //------------------------------------------------------------------------------ class BVideoImage { public: BVideoImage(BPoint size, color_space cspace, video_layout vlayout, buffer_orientation orientation, bool xx); virtual ~BVideoImage(); bool IsValid() const; uint8 BitsPerPixel(); void* Buffer() const; SetBuffer(const void* , bool); uint32 BytesPerRow() const; SetBytesPerRow(uint32 value); color_space ColorSpace() const; SetColorSpace(color_space value); uint32 FrameNumber() const; SetFrameNumber(uint32 value); BPoint ImageSize() const; SetImageSize(BPoint value); bool IsLogical() const; SetLogical(bool value); video_layout Layout() const; SetLayout(video_layout); buffer_orientation Orientation() const; SetOrientation(buffer_orientation); long Status(void) const; SetStatus(long); BTimecode Timecode() const; SetTimecode(BTimecode); bigtime_t Timestamp() const; SetTimestamp(bigtime_t time_stamp); private: virtual void _ReservedVideoImage1(); virtual void _ReservedVideoImage2(); virtual void _ReservedVideoImage3(); } //------------------------------------------------------------------------------ class BVideoMux { public: BVideoMux(const char* name); virtual ~BVideoMux(); const char* Name() { return fName; }; uint32 NumberInputs(); uint32 Source() const; // BVideoSource* ? void SetSource(uint32); private: virtual void _ReservedVideoMux1(); virtual void _ReservedVideoMux2(); virtual void _ReservedVideoMux3(); const char* fName; } //------------------------------------------------------------------------------ class Bt848VideoMux { public: Bt848VideoMux(const char* name, uint32 , bt848_config* ) virtual ~Bt848VideoMux(); bool ColorBars() const; SetColorBars(bool enabled); uint32 NumberInputs(); SetSource(uint32 source); } //------------------------------------------------------------------------------ class BVideoSource { public: BVideoSource(const char* name); virtual ~BVideoSource(); const char* Name() { return fName; }; status_t InitCheck(); // Interface to inner working classes. BAudioMux* AudioMux() const; // it's * or & ??? BI2CBus* I2CBus() const; BTuner* Tuner() const; BVideoMux* VideoMux() const; BVideoControls* VideoControls() const; uint32 CaptureMode() const; SetCaptureMode(uint32 capture_mode); ConfigureCapture(BVideoImage**, short** , uint32 , void** , BVideoImage** , short** ) StartCapture(bool); StopCapture(); ContinueCapture(); RestartCapture(); SwitchCapture(); uint64 FramesDropped() const; LastFrame(uint32* ); NextFrame(uint32* ); NextFrameWithTimeout(bigtime_t , uint32* ); video_format VideoFormat() const; SetVideoFormat(video_format); private: virtual void _ReservedVideoSource1(); virtual void _ReservedVideoSource2(); virtual void _ReservedVideoSource3(); const char* fName; } //------------------------------------------------------------------------------ class Bt848Source { public: Bt848Source(const char* name) virtual ~Bt848Source(); AddressType(video_field_specifier) const; AllocateCaptureBuffer(bt848_buffer* ); BAudioMux* AudioMux() const; // it's * or & ??? BVideoMux* VideoMux() const; BI2CBus* I2CBus() const; BTuner* Tuner() const; BVideoControls* VideoControls() const; uint32 CaptureMode() const; SetCaptureMode(uint32); color_space ColorSpace(video_field_specifier) const; SetColorSpace(color_space, video_field_specifier); bt848_tuner_mfg TunerBrand() const; SetTunerBrand(bt848_tuner_mfg) video_format VideoFormat() const; SetVideoFormat(video_format); uint32 Gpio(); void SetGpio(uint32 value); bool Pll() const; void SetPll(bool enabled); ConfigureCapture(BVideoImage** , short** , uint32 , void** , BVideoImage** , short** ) ConfigureDualCapture(BVideoImage** , short** , BVideoImage** , short** , uint32 , void** ) ConfigureSingleCapture(BVideoImage** , short** , uint32 , void** ) StartCapture(bool); ContinueCapture(); StopCapture(); RestartCapture(); uint32 Decimation() const; SetDecimation(uint32 decimation); uint16 DeviceID() const; FreeCaptureBuffer(bt848_buffer* ); GetFrame(uint32); GpioInEnable(uint32); GpioOutEnable(uint32); status_t InitCheck(); LastFrame(uint32* ); NextFrame(uint32* ); NextFrameWithTimeout(bigtime_t, uint32* ); bool Probe(); SetAddressType(uint32, video_field_specifier); SwitchCapture(uint32* ); bool VideoPresent(); WaitForFrame(bigtime_t howLong, uint32* frame); } //------------------------------------------------------------------------------ // Media Kit Interfaces. class BBt848Controllable { // BControllable protected: BBt848Controllable(int , uint32 , const char*, const char* , BMediaAddOn* ) virtual ~BBt848Controllable(); public: virtual status_t GetParameterValue(int32 parameterID, bigtime_t* lastChangeTime, void* value, size_t* ioSize); virtual void SetParameterValue(int32 parameterID, bigtime_t changeTime, const void* value, size_t size); // BMediaEventLooper : BMediaNode virtual BMediaAddOn* AddOn(int32* outInternalID) const; virtual void NodeRegistered(); virtual void HandleEvent(const media_timed_event* event, bigtime_t lateness, bool realTimeEvent); virtual status_t HandleMessage(int32 message, const void* data, size_t size); protected: virtual status_t DeleteHook(BMediaNode* node); virtual void Preroll(); virtual void Start(bigtime_t performanceTime); virtual void Stop(bigtime_t performanceTime, bool immediate); virtual void SetRunMode(BMediaNode::run_mode mode); // BBufferProducer public: virtual status_t AdditionalBufferRequested(const media_source& source, media_buffer_id previousBufferID, bigtime_t previousTime, const media_seek_tag* previousTag); virtual void Connect(status_t status, const media_source& source, const media_destination& destination, const media_format& format, char* ioName); virtual void Disconnect(const media_source& source, const media_destination &destination); virtual status_t DisposeOutputCookie(int32 cookie); virtual void EnableOutput(const media_source& whichOutput, bool enabled, int32 *_depreciated_); virtual status_t FormatChangeRequested(const media_source& source, const media_destination& destination, media_format* ioFormat, int32 *_depreciated_); virtual status_t FormatProposal(const media_source& output, media_format* format); virtual status_t FormatSuggestionRequested(media_type type, int32 quality, media_format* format); virtual status_t GetLatency(bigtime_t* outLatency); virtual status_t GetNextOutput(int32* cookie, media_output* outOutput); virtual void LateNoticeReceived(const media_source& whichSource, bigtime_t howLate, uint32 performanceTime); virtual status_t PrepareToConnect(const media_source& whichSource, const media_destination& whichDestination, media_format* format, media_source* outSource, char* outName); virtual status_t SetBufferGroup(const media_source& forSource, BBufferGroup* group); virtual status_t SetPlayRate(int32 numerator, int32 denominator); virtual status_t TimeSourceOp(const BTimeSource::time_source_op_info& op, void *_reserved); virtual status_t VideoClippingChanged(const media_source& forSource, int16 numShorts, int16* clipData, const media_video_display_info& display, int32* outFromChangeTag); private: // ? Initialize(); Uninitialize(); ReadFmFavorites(); ReadTvFavorites(); ConstructControlWeb(); RequestNewWeb(); FindIndex(const char**, const char*); HandleStart(bigtime_t); HandleStop(bigtime_t); PrepareBufferMap(); MapCaptureBuffers(BBufferGroup* , const media_video_display_info&, BVideoImage **, uint32&); SendBuffers(BVideoImage*, uint32); SetUpSettings(const char*, const char*); QuitSettings(); ReconfigureCapture(); RestartCapture(bool); StartCapture(); StopCapture(); SwitchCapture(); } //------------------------------------------------------------------------------ class Bt848MediaAddOn { public: Bt848MediaAddOn(image_id image) virtual ~Bt848MediaAddOn() virtual status_t AutoStart(int32 index, BMediaNode** outNode, int32* outInternalID, bool* outHasMore); virtual int32 CountFlavors(); virtual status_t GetConfigurationFor(BMediaNode* node, BMessage* config); virtual status_t GetFlavorAt(int32 flavorNum, const flavor_info** outInfo); virtual status_t InitCheck(char const** outFailureText) virtual BMediaNode* InstantiateNodeFor(const flavor_info* info, BMessage* config, status_t* outError); virtual bool WantsAutoStart(); private: // ? SaveConfigInfo(BMediaNode* node, BMessage* config); } //------------------------------------------------------------------------------