Contenu connexe
Similaire à резников дмитрий
Similaire à резников дмитрий (20)
резников дмитрий
- 2. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Пакет рассчитанный на разработчиков
нативных и мультимедийных приложений
Отладка
Оптимизация
Повышение производительности и
энергоэффективности приложений
2
Intel® INDE
- 3. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Находится по адресу http://software.intel.com/en-us/intel-inde
3
Intel® INDE
- 4. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
4
Менеджер пакетов
- 5. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
• Media
• Intel C++ Compiler for Android
• Intel Threading Building Blocks
• Compute Code Builder
• Intel GPA
5
Что внутри
- 6. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
• Транскодирование видео с заданными параметрами.
• Обрезка видео (сегментирование)
• Склейка нескольких файлов в один
• Захват видео в приложениях, использующих OpenGL
• Наложение аудио, видео эффектов
• Трансляция видео
• Получение информации о медиа файле
• Работает на всех устроствах с Android 4.3 и выше 6
Media
- 7. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
• Оптимизирующий компилятор доступный для Android
• Может дать до 30% прироста производительности после
простой пересборки проекта
• Стоимость при покупке как отдельного продукта $79.95, в
составе INDE – бесплатно
• Совместим с GNU C++, легко интегрируется в Eclipse, MS
Visual Studio
7
Intel C++ Compiler for Android
- 8. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
• Кроссплатформенная библиотека шаблонов для создания
параллельного кода
• Абстрагирует работу над созданием, синхронизацией
потоков, данных
• Скрывает детали архитектуры, позволяя работать на более
высоком, абстрактном уровне
8
Intel Threading Building Blocks
- 9. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
• Отладка, анализ кода Google Renderscript и OpenCL
• Работает как отдельно, так и как часть Eclipse или MS
Visual Studio
9
Compute Code Builder
- 10. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Инструменты для анализа различных факторов, влияющих на
производительность и энергопотребление мобильных
приложений
• GPA System Analyzer
• GPA Frame Analyzer
• GPA Platform Analyzer
10
Intel GPA
- 11. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
11
GPA System Analyzer
- 12. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
12
GPA Frame Analyzer
- 13. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
13
GPA Frame Analyzer
- 14. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
14
GPA Platform Analyzer
- 15. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Media Pack
15
- 16. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
• Надстройка над нативными компонентами Android
• MediaExtractor
• MediaCodec
• MediaMuxer
• Использует аппаратное ускорение
• Работает на всех архитектурах
• Требование – Android 4.3 и выше
16
Media Pack
- 17. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
17
Установка
- 18. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Поставляется как набор библиотек + примеры
18
Media Pack
- 19. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
• Game Capturing – захват видео из приложения, использующего Open GL
• Transcode Video – преобразование видео с заданными параметрами
• Join Video – склейка двух видео файлов
• Cut Video – вырезание из видео заданного сегмента
• Video Effect – преобразование видео с наложением видео эффекта
• Audio Effect - преобразование видео с наложением аудио эффекта
• Streaming from Camera – трансляция видео с камеры на сервис Wowza
• Get Media File Info – получение информации о медиа файле
19
Примеры
- 20. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Перекодирование видео
20
- 21. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
21
Перекодирование видео
• ComposerTranscodeActivity – обеспечивает выбор видео файла и
отображает его на предпросмотре
• ComposerTranscodeCoreActivity – выводит подробную информацию о
выбранном видео файле, выполняет его преобразование
- 22. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Ключевым компонентом является класс MediaComposer
Реализация включает 5-ть простых шагов
• Создать объект MediaComposer
• Указать путь к исходному, результирующему файлам
• Задать параметры результирующего видео
• Реализовать интерфейс MediaComposer.IProgressListener 22
Перекодирование видео
- 23. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
1. Создать объект MediaComposer
MediaComposer mediaComposer = new
AndroidMediaObjectFactory(getApplicationContext());
• AndroidMediaObjectFactory – фабрика, с помощью которой
инициализируются все классы Media Pack
23
Инициализация MediaComposer
- 24. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
2. Указать путь к исходному, результирующему файлам
String srcPath = “…”;
String dstPath = “…”;
mediaComposer.addSourceFile(srcPath);
mediaComposer.setTargetFile(dstPath);
24
Пути к файлам
- 25. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
3. Задать параметры результирующего видео
String videoMimeType = “video/avc”;
int videoFrameWidth = 640;
int videoFrameHeight = 480;
int videoBitRate = 5000;
int videoFrameRate = 30;
int videoIFrameInterval = 1;
VideoFormatAndroid videoFormat = new VideoFormatAndroid(videoMimeType, videoFrameWidth, videoFrameHeight);
videoFormat.setVideoBitRateInKBytes(videoBitRate);
videoFormat.setVideoFrameRate(videoFrameRate); 25
Параметры видео
- 26. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
3. Задать параметры результирующего видео
String audioMimeType = “audio/mp4a-latm”;
int audioSampleRate = 48000;
int audioChannelCount = 2;
int audioProfile = MediaCodecInfo.CodecProfileLevel.AACObjectLC;
AudioFormatAndroid audioFormat = new AudioFormatAndroid(audioMimeType , audioSampleRate, audioChannelCount);
audioFormat.setAudioBitrate(audioBitRate);
audioFormat.setAudioAacProfile(audioProfile);
mediaComposer.setTargetAudioFormat(audioFormat); 26
Параметры аудио
- 27. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
4. Реализовать интерфейс MediaComposer.IProgressListener
public MediaComposer.IProgressListener progressListener = new MediaComposer.IProgressListener();
• public void onMediaStart()
• public void onMediaProgress(float progress)
• public void onMediaDone()
• public void onMediaPause()
• public void onMediaStop()
• public void onError(Exception exception)
27
Обратные вызовы
- 28. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
mediaComposer.start();
• Создание, инициализация декодера, энкодера, муксера
• Построение конвейера
• Декодирование, обработка, кодирование
28
Запуск
- 29. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Захват видео в играх
29
- 30. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
• Создает поверхность
• Приложение рисует очередной кадр на экран и на
поверхность GLCapture
• Кодирует отрисованный кадр в видео
30
Захват видео в играх
- 31. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Реализация включает 5-ть шагов
• Создать объект GLCapture
• Указать путь к видео файлу
• Задать параметры видео
• Запустить процесс, cконфигурировать поверхность
• Внести изменения в функцию рисования
31
Захват видео в играх
- 32. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
1. Создать объект GLCapture
GLCapture capture = new GLCapture(new
AndroidMediaObjectFactory());
32
Создание объекта GLCapture
- 33. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
2. Указать путь к видео файлу
String videoPath = “…”;
capture.setTargetFile(videoPath);
33
Куда записываем
- 34. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
3. Задать параметры видео
int videoWidth = 720;
int videoHeight = 1280;
int videoFrameRate = 30;
int videoIFrameInterval = 1;
int videoBitRate = 1000;
String videoCodec = "video/avc";
VideoFormatAndroid videoFormat = new VideoFormatAndroid(videoCodec, videoWidth, videoHeight);
videoFormat.setVideoBitRateInKBytes(videoBitRate);
videoFormat.setVideoFrameRate(videoFrameRate);
34
Параметры видео
- 35. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
4. Запустить процесс, cконфигурировать поверхность
capture.start();
В функции с активным OpenGL контекстом
• onSurfaceChanged(GL10 gl, int width, int height)
• onDrawFrame(GL10 gl)
35
Запуск
- 36. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
render();
capture.beginCaptureFrame();
render();
capture.endCaptureFrame();
36
Функция рисования
- 37. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
• beginCaptureFrame – переключает текущий Open GL
контекст на контекст поверхности
• endCaptureFrame – восстанавливает предыдущий контекст
37
Функция рисования
- 38. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
frameBuffer.bind();
renderScene();
frameBuffer.unbind();
texture.draw(frameBuffer.getTexture());
capture.beginCaptureFrame();
texture.draw(frameBuffer.getTexture()); 38
Использование Frame Buffer
- 39. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Заключение
39
- 40. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
• Не требует начальных знаний о том как работают медиа
компоненты Android
• Разрабатывайте приложение, не теряя время на отладку
• Предлагает множество моделей использования
40
Преимущества INDE Media Pack
- 41. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Полезные ресурсы
41
- 42. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
http://software.intel.com/en-us/intel-inde
http://software.intel.com/en-us/articles/intel-inde-frequently-asked-
questions
http://software.intel.com/en-us/forums/intel-integrated-native-
developer-experience-intel-inde
Dmitry.Rizshkov@intel.com 42
Полезные ресурсы
- 43. Copyright © 2014, Intel Corporation. All rights reserved. *Other names and brands may be claimed as the property of others. Optimization Notice
Legal Disclaimer & Optimization Notice
INFORMATION IN THIS DOCUMENT IS PROVIDED “AS IS”. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL
OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. INTEL
ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY,
RELATING TO THIS INFORMATION INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A
PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER
INTELLECTUAL PROPERTY RIGHT.
Software and workloads used in performance tests may have been optimized for performance only on Intel
microprocessors. Performance tests, such as SYSmark and MobileMark, are measured using specific computer
systems, components, software, operations and functions. Any change to any of those factors may cause the results to
vary. You should consult other information and performance tests to assist you in fully evaluating your contemplated
purchases, including the performance of that product when combined with other products.
Copyright © 2014, Intel Corporation. All rights reserved. Intel, Pentium, Xeon, Xeon Phi, Core, VTune, Cilk, and the Intel
logo are trademarks of Intel Corporation in the U.S. and other countries.
Optimization Notice
Intel’s compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors.
These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or
effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use
with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable
product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.
Notice revision #20110804
43