camerauis/cameraxui/cxengine/inc/cxevideocapturecontrolsymbian.h
changeset 43 0e652f8f1fbd
parent 28 3075d9b614e6
child 45 24fd82631616
equal deleted inserted replaced
28:3075d9b614e6 43:0e652f8f1fbd
    36 class CxeSettings;
    36 class CxeSettings;
    37 class CxeCameraDevice;
    37 class CxeCameraDevice;
    38 class CxeQualityPresets;
    38 class CxeQualityPresets;
    39 class CxeFilenameGenerator;
    39 class CxeFilenameGenerator;
    40 class CxeViewfinderControl;
    40 class CxeViewfinderControl;
       
    41 class CxeSnapshotControl;
    41 class CxeStillImageSymbian;
    42 class CxeStillImageSymbian;
    42 class CxeSoundPlayerSymbian;
    43 class CxeSoundPlayerSymbian;
    43 class CxeCameraDeviceControl;
    44 class CxeCameraDeviceControl;
    44 class CxeVideoRecorderUtility;
    45 class CxeVideoRecorderUtility;
    45 class CxeDiskMonitor;
    46 class CxeDiskMonitor;
    53 
    54 
    54 public:  // constructors
    55 public:  // constructors
    55 
    56 
    56     CxeVideoCaptureControlSymbian(CxeCameraDevice &cameraDevice,
    57     CxeVideoCaptureControlSymbian(CxeCameraDevice &cameraDevice,
    57                                   CxeViewfinderControl &viewfinderControl,
    58                                   CxeViewfinderControl &viewfinderControl,
       
    59                                   CxeSnapshotControl &snapshotControl,
    58                                   CxeCameraDeviceControl &cameraDeviceControl,
    60                                   CxeCameraDeviceControl &cameraDeviceControl,
    59                                   CxeFilenameGenerator &nameGenerator,
    61                                   CxeFilenameGenerator &nameGenerator,
    60                                   CxeSettings &settings,
    62                                   CxeSettings &settings,
    61                                   CxeQualityPresets &qualityPresets,
    63                                   CxeQualityPresets &qualityPresets,
    62                                   CxeDiskMonitor &diskMonitor);
    64                                   CxeDiskMonitor &diskMonitor);
    72     bool elapsedTime(int &time);
    74     bool elapsedTime(int &time);
    73     void reset();
    75     void reset();
    74     QString filename() const;
    76     QString filename() const;
    75     QPixmap snapshot() const;
    77     QPixmap snapshot() const;
    76     QList<CxeVideoDetails> supportedVideoQualities();
    78     QList<CxeVideoDetails> supportedVideoQualities();
    77 
       
    78 public:  // public member functions, not in client API
       
    79     void handleSnapshotEvent(CxeError::Id error);
       
    80 
    79 
    81 public: // functions from MVideoRecorderUtilityObserver
    80 public: // functions from MVideoRecorderUtilityObserver
    82     void MvruoOpenComplete(TInt aError);
    81     void MvruoOpenComplete(TInt aError);
    83     void MvruoPrepareComplete(TInt aError);
    82     void MvruoPrepareComplete(TInt aError);
    84     void MvruoRecordComplete(TInt aError);
    83     void MvruoRecordComplete(TInt aError);
    96     void init();
    95     void init();
    97     //! Notification for when we're exiting video mode
    96     //! Notification for when we're exiting video mode
    98     void deinit();
    97     void deinit();
    99     //! Notification that videocapture sound has been played
    98     //! Notification that videocapture sound has been played
   100     void handleSoundPlayed();
    99     void handleSoundPlayed();
       
   100     //! Snapshot has been received from adaptiation.
       
   101     void handleSnapshotReady(CxeError::Id status, const QImage &snapshot);
   101 
   102 
   102 protected slots:
   103 protected slots:
   103     // notifications when ECam reference is changed
   104     // notifications when ECam reference is changed
   104     void prepareForCameraDelete();
   105     void prepareForCameraDelete();
   105     void handleCameraAllocated(CxeError::Id error);
   106     void handleCameraAllocated(CxeError::Id error);
   106     void prepareForRelease();
   107     void prepareForRelease();
   107     // ECam events
       
   108     void handleCameraEvent(int eventUid, int error);
       
   109     // settings call back
   108     // settings call back
   110     void handleSettingValueChanged(const QString& settingId,QVariant newValue);
   109     void handleSettingValueChanged(const QString& settingId,QVariant newValue);
   111     // scene mode change
   110     // scene mode change
   112     void handleSceneChanged(CxeScene& scene);
   111     void handleSceneChanged(CxeScene& scene);
   113     // Disk space change
   112     // Disk space change
   114     void handleDiskSpaceChanged();
   113     void handleDiskSpaceChanged();
   115 
   114 
   116 private: // helper methods
   115 private: // helper methods
   117     CxeError::Id findVideoController(const TDesC8& aMimeType, const TDesC&  aPreferredSupplier);
       
   118     void releaseResources();
   116     void releaseResources();
   119     void initializeStates();
   117     void initializeStates();
   120     CxeError::Id getVideoQualityDetails(CxeVideoDetails &videoInfo);
   118     void getVideoQualityDetails(CxeVideoDetails &videoInfo);
   121     int prepareVideoSnapshot();
       
   122     void initVideoRecorder();
   119     void initVideoRecorder();
   123     void open();
   120     void open();
   124     void prepare();
   121     void prepare();
   125     TSize getSnapshotSize() const;
       
   126     virtual void createVideoRecorder();
   122     virtual void createVideoRecorder();
   127     void calculateRemainingTime(CxeVideoDetails videoDetails, int &time);
   123     int calculateRemainingTime(const CxeVideoDetails& videoDetails);
   128     TFourCC audioType(const QString& str);
       
   129     void updateRemainingRecordingTimeCounter();
   124     void updateRemainingRecordingTimeCounter();
       
   125     void generateFilename();
       
   126     void handlePrepareFailed();
       
   127     void handleComposeFailed(int error);
       
   128     void emulateNormalStopping();
   130 
   129 
   131 protected: // protected data
   130 protected: // protected data
   132     //! Video Recorder
   131     //! Video Recorder
   133     CxeVideoRecorderUtility *mVideoRecorder;
   132     CxeVideoRecorderUtility *mVideoRecorder;
   134 
   133 
   139     //! Video Recorder format UID.
   138     //! Video Recorder format UID.
   140     TUid mVideoFormatUid;
   139     TUid mVideoFormatUid;
   141     CxeCameraDevice &mCameraDevice;
   140     CxeCameraDevice &mCameraDevice;
   142     CxeCameraDeviceControl &mCameraDeviceControl;
   141     CxeCameraDeviceControl &mCameraDeviceControl;
   143     CxeViewfinderControl &mViewfinderControl;
   142     CxeViewfinderControl &mViewfinderControl;
       
   143     CxeSnapshotControl &mSnapshotControl;
   144     CxeFilenameGenerator &mFilenameGenerator;
   144     CxeFilenameGenerator &mFilenameGenerator;
   145     CxeSettings &mSettings;
   145     CxeSettings &mSettings;
   146     CxeQualityPresets &mQualityPresets;
   146     CxeQualityPresets &mQualityPresets;
   147     CxeDiskMonitor &mDiskMonitor;
   147     CxeDiskMonitor &mDiskMonitor;
   148     //! Snapshot image.
   148     //! Snapshot image.
   149     QPixmap mSnapshot;
   149     QPixmap mSnapshot;
   150     //! Soundplayers, own
   150     //! Soundplayers, own
   151     CxeSoundPlayerSymbian *mVideoStartSoundPlayer;
   151     CxeSoundPlayerSymbian *mVideoStartSoundPlayer;
   152     CxeSoundPlayerSymbian *mVideoStopSoundPlayer;
   152     CxeSoundPlayerSymbian *mVideoStopSoundPlayer;
   153     //! New file name generated for the video prepare.
       
   154     QString mNewFileName;
       
   155     //! Current video file name
   153     //! Current video file name
   156     QString mCurrentFilename;
   154     QString mCurrentFilename;
   157     //video resolutions supported by ICM
   155     //video resolutions supported by ICM
   158     QList<CxeVideoDetails> mIcmSupportedVideoResolutions;
   156     QList<CxeVideoDetails> mIcmSupportedVideoResolutions;
   159     //current video quality details in use
   157     //current video quality details in use