Implementation of Media Player Based on Android Platform

International Journal of Engineering Technology, Management and Applied Sciences www.ijetmas.com February 2015, Volume 3 Issue 2, ISSN 2349-4476 Imp...
Author: Lester Morgan
0 downloads 1 Views 430KB Size
International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com February 2015, Volume 3 Issue 2, ISSN 2349-4476

Implementation of Media Player Based on Android Platform Shital Somkuwar

Prerana Dakhane

Student, VIII Sem, B.E., Computer Science and Engineering R.G.C.E.R., Nagpur

Student, VIII Sem, B.E., Computer Science and Engineering R.G.C.E.R., Nagpur

Hiteshri Ambone Student, VIII Sem, B.E., Computer Science and Engineering R.G.C.E.R., Nagpur

Pooja Bhoyar

Ruchika Supsande

Student, VIII Sem, B.E., Computer Science and Engineering R.G.C.E.R., Nagpur

Student, VIII Sem, B.E., Computer Science and Engineering R.G.C.E.R., Nagpur

Prof. Nikhil S. Sakhare Assistant Professor, Department of Computer Science and Engineering, R.G.C.E.R., Nagpur

ABSTRACT – Android which is an open source operating system was created by Google in 2007 especially for use on the mobile devices. It is a Linux based Operating System that can be programmed in C/C++ but most app development is done in Java. This paper deals with the design and implementation of media player used to play different audio file formats, but there are some file formats not supported in android media players. Keywords –Java, Android, Media player, BASS. I. INTRODUCTION Android is an open source mobile OS, developed by the Open Handset Alliance launched by Google, based on the Linux kernel. It is an open platform for developers, users and industry which is most widely used. Android was created for full phone software stack. Media Player is software for playing Audio file formats and which displays the lyrics. Nowadays playing a audio file in mobile phone is obvious, but the drawback of these media players is that it does not support the various file formats available. So a reliable media player for android is needed. If we are developing a media player by ourselves, it will be a complex part. The library used in this media player is BASS. BASS is an audio library used in software on several platforms. The main purpose of BASS is streaming and recording. This Android Media Player includes Android supported format (default), Media player API, library called BASS and some additional supported format. Android provides many ways to control playback of audio files. One of this ways is through a class called Media Player. Android applications are usually developed in the Java language. These applications are usually developed by using the Android Software Development Kit. A. Hardware Requirements Android 4.0 or greater require an ARMv7 processor B. Software Requirements

171

Shital, Prerana, Hiteshri, Pooja, Ruchika, Prof. Nikhil S

International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com February 2015, Volume 3 Issue 2, ISSN 2349-4476 1) Eclipse Indigo SDK 2) Android SDK (ADT bundle) 3) JDK 6 or greater The android architecture is show Figure.1.The architecture consists of five main components like Applications, Application framework, libraries, Android runtime, Linux kernel.

Figure:1 Architecture of Android A.

Application The application layer is the top most layer present in architecture. This layer consists of applications like web browser, calendar, SMS app, contacts app etc. B.

Application Framework Application framework is base of developing Apps in the Android. The components of Application Framework are the activity manager, window manager, content provider and view system, the package manager, notification manager etc. C. Libraries The libraries include Media Framework, Web Kit, SGL Free Type, and SQLite. These capabilities are exposed to developers through the Android Application framework. D. Android Runtime In android users develop applications with Java programming language, but Android uses its own Android Runtime. Android Runtime consists of a set of core libraries and the Dalvik Virtual

172

Shital, Prerana, Hiteshri, Pooja, Ruchika, Prof. Nikhil S

International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com February 2015, Volume 3 Issue 2, ISSN 2349-4476 Machine. The Dalvik virtual machine is executing files in the .dex (Dalvik Executable) which are optimized for the minimal CPU and memory usage and supports running multiple virtual machines efficiently. E. Linux Kernel Android relies on Linux for core system services such as security, memory management, network stack, driver model. The Linux core also acts as a hardware abstraction layer between the applications and all the hardware. II. LITERATURE REVIEW Table. I Sr. no.

1.

Paper Title

TTechniques

Research on Media Player Based on

• Media player scans Storage

Android

equipment

Authors: ShuangyanJin, Haoliang Li and



Yongfei Liu

The lyrics of the

file can be displayed

synchronous

published Year: 2012

2.

Plug-in

Extension



Uses an open source audio and video solution

on

Android



FFMPEG implements a plug-in media player

Design and Implementation of Java Media



used to play different media files

Player



Results in a variety of media files with different

The

Research

Technology

of Based

Multimedia Player Platform Authors: “Jin He, Jiaming He” published Year: 2011

3.

Authors: Muhanad Hayder

type for processing these file.

published Year: 2007

4.

Design and Implementation of Media



the paper designs a new media player structure

Player Based on Android



FFMPEG is decode library and SDL is display

Author:

Maoqiang

Song,

Jie

Sun,

library

Xiangling Fu, WenkuoXiong published Year: 2007

173

Shital, Prerana, Hiteshri, Pooja, Ruchika, Prof. Nikhil S

International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com February 2015, Volume 3 Issue 2, ISSN 2349-4476 III. STRUCTURE OF MEDIA PLAYER Creating a media player is not a complex part but decoding audio stream is more complex work to do. To play media files media player first gathers media files then decodes the audio file and displays the data after decoding it. There are three steps while creating or designing media player as given below. 1. Media player needs to parse the coding format of files. 2. Decode the original data by the decode programs. 3. Put the original data into the buffer queues, and display the data after synchronization. The following fig.2 shows the structure of media player which consist of four layers .The layers are UI, decode layer, pretreatment layer and Data extraction layer. The first layer is a Data Extraction Layer that extracts all the media files separately by reading it. Pretreatment layer is the next layer which is very important layer to demux the media files.

The following fig.2 shows the structure of media player which consist

Figure.2Structure of media player After demuxing the information of media files are stored in the buffer. Next layer is the decode layer that selects the proper decoder to decode the audio streams and synchronize it. The next higher layer is UI layer that is user interface that displays the original data for the users. III. FUNCTIONING OF MEDIA PLAYER A. BASS library BASS library is open-source codec library. It supports many more formats than FFMPEG [1]. It is user-friendly and plays almost all formats and possesses great build-in features. BASS library uses FFMPEG library internally. BASS is free for non commercial use. It is available for android and many other operating systems.

174

Shital, Prerana, Hiteshri, Pooja, Ruchika, Prof. Nikhil S

International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com February 2015, Volume 3 Issue 2, ISSN 2349-4476 FFMPEG is free software that can build libraries and programs for handling multimedia files or multimedia data. It supports over 90 different decoders and also supports protocols. B. Audio File Format types An audio codec performs the encoding and decoding of the raw audio data while the data itself is stored in the file with a specific audio file format. There are three major variations of audio file formats: 1. Uncompressed audio format 2. Lossless compressed audio format 3. Lossy compressed audio format 1. Uncompressed audio format: Uncompressed audio format is just as the name suggests –formats that use no compression. They are bulky files and take up considerable space on hard disk or storage drive. The advantage of uncompressed audio format is that the quality of the digital audio remains constant, as it is unchanged. e.g. WAV (.wav file) 2. Lossless compressed audio format: Lossless compressed audio format stores data in less space by eliminating unnecessary data. They enable the original uncompressed data to be recreated. Development in Lossless compression formats aims to reduce processing time while maintaining a good compression ratio (2:1). e.g. FLAC, WMA, M4A. 3. Lossy compressed audio format: Lossy compression enables even greater reduction in file size by removing some of the data. Lossy compression achieves greater compression than lossless compression by simplifying the complexities of the data. Lossy compression has become popular because of its small file size. The popular mp3 format is the best-known example and the AAC format found on the iTunes Music Store e.g. AAC, MP3, OGG, AMR. C. Life Cycle of Media Player Understanding the life cycle of media player is important before building a media player. The following fig.3 shows the complete description of media player. Idle, initialized, prepared, started, paused, completed, stopped, preparing are the states of cycle[5]. States: (a) Idle state: This state is relatively simple. Media Player loads all media files into the buffer to set up audio files. Media Player call setDataSource () method to enter the Initialized state. (b) The Initialized state: This state is relatively simple. Media Player loads all media files into the buffer to set up audio files. Media Player calls the setDataSource () method to enter the Initialized state.

175

Shital, Prerana, Hiteshri, Pooja, Ruchika, Prof. Nikhil S

International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com February 2015, Volume 3 Issue 2, ISSN 2349-4476 (c) The Prepared state: After the initialization is done synchronization of audio stream is done so the file can be played.

Figure:3 Life Cycle of Media Player (d) The Preparing state: In this state the synchronization of streams is done and then it enters into the Prepared state. (e) The Started state: Apparently, Media Player once ready, you can select a file, so that the Media Player is in the Started, which indicates that Media Player is in the process of playing the file. If the finished playing, and set the loop, then Media Player will still be in the Started state, and remains in the Started state. (f) The Paused state: Under the condition of Started Media Player call pause () method that suspend Media Player, to enter the Paused state, Media Player again calls suspended after the start. (g) The Stop state: Started or Paused state can call stop () to stop the Media Player, and also to replay audio file. (h) The Completed state: In this state file completes playing, and it does not enter into any other state. At this point you can call start () method to start playing the file, or stop (Media Player), or seekTo () to reposition the playback position. IV.USER INTERFACE A GUI provides an interactive environment for user to perform various tasks on devices like mobile and computers. The most common combination of such elements in GUIs is the window,

176

Shital, Prerana, Hiteshri, Pooja, Ruchika, Prof. Nikhil S

International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com February 2015, Volume 3 Issue 2, ISSN 2349-4476 icon, menu, buttons etc. Media player is shown in fig. 4 which is an interactive application. The Software supports the popup menu when the user right click on the player screen as shown in the figure4.The user can easily access the media player.

Figure:4 Media Player(GUI) The main advantage of media player given from this paper supports multiple file formats as compared to the general media player. Also the newly constructed GUI is provided for user and the quality of audio streaming is improved. V. CONCLUSION This paper designs and implements a powerful media player base on Android. In the paper the decode module is based on BASS decode library and display module is based on SDL. The proper structure of media player is defined in this paper.AS Compare to the original media player in Android; the newly created media player in this paper supports more media file formats in an efficient manner. ACKNOWLEDGMENT We are grateful to Prof. Nikhil Sakhare for giving their suggestions and opinions for this paper. Their views had enabled to improve our final paper. REFERENCES [1] JieSun, WenkuoXiong. 2011. Design and Implementation of media player based on android. [2] ShuangyanJin, Haoliang Li and Yongfei Liu.2012. Research on media player based on Android. [3] Jin He Jiaming He. The research of Plug-in Extension based on android multimedia platform.

177

Shital, Prerana, Hiteshri, Pooja, Ruchika, Prof. Nikhil S

International Journal of Engineering Technology, Management and Applied Sciences

www.ijetmas.com February 2015, Volume 3 Issue 2, ISSN 2349-4476 [4] MaoqiangSong, WenkuoXiong, XianglingFu. Research on Architecture of multimedia and its Design

based on Android.

[5] Muhanad Hayder .Design and Implementation of Java media player. [6] MunnebAhemedQureshiM.Madan.Gopal& Mohamed Sadiq. Design and Implementation ofAudio/Video Codec based on Android platform. [7] Xiangling Fu, Maoqiang Song, Mian Chen. Research on audio/video codec based on android. [8] Magazine issue of September 2013. Open Source for You . [9] http://www. Wikipedia .com\Windows Media Player, the free encyclopedia.mht

178

Shital, Prerana, Hiteshri, Pooja, Ruchika, Prof. Nikhil S