symba (779893), страница 21

Файл №779893 symba (Symbian Books) 21 страницаsymba (779893) страница 212018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 21)

That defines one methodthat you need to override in your own class:class CMyAudioResourceNotification : public CBase,public MMMFAudioResourceNotificationCallback{public:void MarncResourceAvailable(TUid aNotificationEventId,const TDesC8& aNotificationData);};The call to RegisterAudioResourceNotification alsotakes a parameter aNotificationEventUid. This should be set to86MULTIMEDIA FRAMEWORK: VIDEOKMMFEventCategoryAudioResourceAvailable. aNotificationRegistrationData is not used and you do not need to specify it,as a default parameter is supplied.RegisterAudioResourceNotification() can be called beforethe video open operation has been performed. When the audio resourcebecomes available, the MarncResourceAvailable() method iscalled with the aNotificationEventId parameter set to KMMFEventCategoryAudioResourceAvailable.If you want to start playing the video again, it is important that you callthe WillResumePlay() method.

This tells the audio system that youwant to take the audio resource back.If the WillResumePlay() method returns KErrNone, this meansyou can now start playing the video again.If you register for the audio resource notification, then you can cancelthe registration later using the CancelRegisterAudioResourceNotification() method:TInt CancelRegisterAudioResourceNotification(TUid aNotificationEventId);The aNotificationEventId parameter should be set to KMMFEventCategoryAudioResourceAvailable.

CancelRegisterAudioResourceNotification() can be called before the videoopen operation has been performed.4.9.2 VolumeYou can set and get the volume for the audio track for the currently openvideo:void SetVolumeL(TInt aVolume);TInt Volume() const;The volume is an integer value from zero, which indicates that thesound is muted, up to the maximum volume available. To obtain the maximum volume available for the audio track you can use the MaxVolume()method.TInt MaxVolume() const;4.9.3 BalanceThe playback balance can be set with SetBalanceL() and retrievedusing Balance():STREAMING PLAYBACK87void SetBalanceL(TInt aBalance);TInt Balance() const;The range of values for balance runs from KMMFBalanceMaxLeftfor maximum left balance, through KMMFBalanceCenter for centeredbalance, to KMMFBalanceMaxRight for maximum right balance.4.9.4 Bit RateIn the same way that the current video bit rate could be retrieved, theaudio bit rate (in bits per second) can also be retrieved:TInt AudioBitRateL() const;4.9.5 Audio TypeThe type of audio track in the open video can be retrieved:TFourCC AudioTypeL() const;This returns the FourCC code of the audio data.4.9.6 Enabling Audio PlaybackFrom Symbian OS v9.4 onwards, it is possible to specify whether theaudio track in a video should be played back or not.

This can be set bycalling SetAudioEnabledL(). If you specify that audio is not enabled,then only the video image data is played.void SetAudioEnabledL(TBool aAudioEnabled);You can also find out whether audio is currently enabled or not.TBool AudioEnabledL() const;4.10 Streaming PlaybackWe have seen in previous sections some of the client API methods thatare specific to video streaming. There are some other important thingsthat need to be considered when streaming is supported.We have seen that the OpenUrlL() method on CVideoPlayerUtility or CVideoPlayerUtility2 is used to open a video for88MULTIMEDIA FRAMEWORK: VIDEOstreaming. What types of streaming are supported depends on the controllers that are installed. You may find that a controller can supporton-demand streaming, live streaming, or both.

Controllers may supportstreaming only from an RTSP server or they may support HTTP progressivedownload.If you are using a live-streaming URL, then it is not possible for theMMF framework to automatically detect the format of the video. In thiscase, you must specify the controller UID as shown in Section 4.4.While streaming data from a server, the playback might pause occasionally because extra data needs to be downloaded or buffered fromthe server. You might want to consider using the video-loading progressmethods to show when this buffering is taking place so that the user doesnot think that your application has crashed:void GetVideoLoadingProgressL(TInt& aPercentageComplete);It is also possible to request callbacks to provide information aboutbuffering during video streaming using the RegisterForVideoLoadingNotification() method.void RegisterForVideoLoadingNotification(MVideoLoadingObserver&aCallback);You need to provide a class that is derived from the MVideoLoadingObserver base class and overrides the MvloLoadingStarted() andMvloLoadingComplete() methods.

Whenever a loading or bufferingoperation starts, the MvloLoadingStarted() method is called. Oncethe loading or buffering completes, the MvloLoadingComplete()method is called. When streaming, it may not be possible for the wholevideo to be received in one go. In this case, multiple calls to the methodswill occur.RegisterForVideoLoadingNotification() can be calledbefore the video open operation has been performed.Certain methods don’t really make any sense during live streaming,such as pausing or seeking to a new position using the SetPosition()method.

If your application knows that live streaming is being used, thenyou might consider disabling these operations in your application so thatthe end user cannot access them.4.11Recording VideoFigure 4.10 shows the user interactions for the basic video record, pause,stop sequence for a file.

They show the API method calls from the userRECORDING VIDEO89UserNewL()CVideoRecorderUtilityOpenFileL()MvruoOpenComplete(KErrNone)Prepare()MvruoPrepareComplete(KErrNone)Record()PauseL()Record()Stop()Close()~CVideoRecorderUtility()Figure 4.10Recording sequenceand the callbacks from the CVideoRecorderUtility class.

In thefollowing sections, we look at these API method calls in more detail.4.11.1 Creating the ClassThe CVideoRecorderUtility is instantiated by calling its staticNewL() method.static CVideoRecorderUtility* NewL(MVideoRecorderUtilityObserver& aObserver,TInt aPriority,TMdaPriorityPreference aPref);90MULTIMEDIA FRAMEWORK: VIDEOAs with video playback, the video recorder class takes a parameter,aObserver, which is used to receive callbacks when asynchronousfunctions have completed. The aPriority and aPref parametersserve the same purpose as the parameters passed to CVideoPlayerUtility::NewL() method.

See Section 4.9.1 for more details aboutthem.The observer parameter for the NewL() method is a class that youmust derive from the base class MVideoRecorderUtilityObserver.Your class must override the methods defined in the MVideoRecorderUtilityObserver class.class CMyVideoRecorderObserver : public CBase,public MVideoRecorderUtilityObserver{public:void MvruoOpenComplete(Tint aError);void MvruoPrepareComplete(Tint aError);void MvruoRecordComplete(Tint aError);void MvruoEvent(const TMMFEvent& aEvent);};These methods are very similar to the playback observer that isdescribed in Section 4.5. Please refer to that section for a fuller description.4.11.2 Opening the Video for RecordingYou can open a file to record a video into using the OpenFileL()methods:void OpenFileL(const TDesC& aFileName, TInt aCameraHandle,TUid aControllerUid, TUid aVideoFormat,const TDesC8& aVideoType, TFourCC aAudioType);void OpenFileL(const RFile& aFile, TInt aCameraHandle,TUid aControllerUid, TUid aVideoFormat,const TDesC8& aVideoType, TFourCC aAudioType);You have the option of specifying a file name into which the videowill be recorded or a handle to a file that is already open for writing.The aCameraHandle parameter is the handle of the camera thatyou want to record from.

Your camera should be created and set upready to start recording. The handle can be obtained using the CCamera::Handle() method. See Section 3.6 for more information onsetting up the camera for recording.When recording a video, you need to specify the UID of the controllerand format that you want to use. You can use code that is very similarRECORDING VIDEO91to the example code in Section 4.4 to do this. Instead of requesting thePlayFormats() for a controller, you choose the record formats, usingthe RecordFormats() method:RMMFFormatImplInfoArray& recordFormats = controllers[i]->RecordFormats();You can also specify which video codec and which audio codec touse for the recording.

Характеристики

Тип файла
PDF-файл
Размер
1,13 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6418
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее